Jump to content


Photo
- - - - -

Category Title Above Post Title?


This topic has been archived. This means that you cannot reply to this topic.
7 replies to this topic

#1 Jason M

Jason M

    Advanced Member

  • Members
  • 71 posts

Posted 03 September 2012 - 06:46 PM

I'm trying to display categories above the post title and I'm referencing the prior post below which included the code I listed below.

Please Login or Register to see this Hidden Content

add_action('the_post', 'add_my_cat'); function add_my_cat( ) { if ( is_home() ) printf( '
%s
', the_category() ); } When I tried the code above and it worked, but I often use multiple categories for each post and they show up as a bulleted list above the title. Even when a post has only one category it's listed with a bullet point to it's left. My site is www.compression.org. I commented the code out for now so the posts don't look bad, but if needed I can show you what it looks like. If there is a way to add CSS to the categories and remove the bullet that would be great. I can then go bad and use only one category and add tags for more detailed classification or something like that. The most important thing is how to get the categories to show up right in the first place. I looked around and it doesn't seem like anyone has "solved" this issue, yet, so anything to get me in the right direction would be much appreciated. Thanks, Jason This isn't my site, but here's something I'd like to do (

Please Login or Register to see this Hidden Content

). A primary category is listed above the title and several other categories are listed below the post.

#2 catrina

catrina

    Advocate

  • Members
  • 12345 posts

Posted 03 September 2012 - 07:13 PM

For the primary category technique, I think that the category can be used as the primary category and WordPress tags can be used as the other/non-primary categories. The tag list can be displayed so that it wouldn't include the primary category (because this would be a category anyway and the rest of the "categories" are tags). The bullets are added because by default,
    lists have bullets. CSS would be needed to get rid of those bullets.

#3 batman

batman

    Bat Learning

  • Members

  • 2167 posts

Posted 03 September 2012 - 07:23 PM

Hi
I prove a CSS rules like say Catrina and it get rid of those bullets in my forum test.

Please Login or Register to see this Hidden Content



#4 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts

Posted 03 September 2012 - 10:41 PM

Thank you Batman for your help and that code.

#5 Jason M

Jason M

    Advanced Member

  • Members
  • 71 posts

Posted 04 September 2012 - 04:40 PM

Thanks. I switched to trying this out on my personal page (www.compression.org) so I could leave things looking wrong. I added Batman's code to the custom style.php and now the bullets are gone but the categories are still a list and if I do ever have multiple categories I'd prefer them to be listed horizontally. Also, I added the code below to custom style.php to display tags below the post and the tags only show up after the post on the post's individual page and then the categories are no longer displaying.

I'd like the tags to show up below the post on the blog page. Thanks.

#6 batman

batman

    Bat Learning

  • Members

  • 2167 posts

Posted 04 September 2012 - 04:58 PM

Hi I believe you have a Universal Slidebar with tags,I see this with firebug, if I understand right You can go to Pagelines > Drag & Drop > Content Area > Blog Post And move the Universal Slidebar as you like :)

#7 Jason M

Jason M

    Advanced Member

  • Members
  • 71 posts

Posted 04 September 2012 - 06:26 PM

I put this in the custom style.php and it seems to work for making the categories display horizontally. ul.post-categories {list-style: none;} ul.post-categories li {display: inline;} I'm not sure how to swap the post content with the post info. It doesn't seem to work on the template page.

#8 Danny

Danny

    Is Awesome!

  • Moderators
  • 17124 posts

Posted 05 September 2012 - 07:56 AM

Hi, Can you provide me with a direct link to where the categories are being listed please.