Jump to content
Sign in to follow this  
Jason M

Category Title Above Post Title?

Recommended Posts

Jason M

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. http://www.pagelines.com/forum/discussion/comment/115787#Comment_115787 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 (http://fresh-energy.org/category/publications/powering-progress/2012-no-08-august/). A primary category is listed above the title and several other categories are listed below the post.

Share this post


Link to post
Share on other sites
catrina

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.

Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
batman

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

ul.post-categories  {list-style: none;}


Life is too short to remove USB safely ...

Share this post


Link to post
Share on other sites
Rob

Thank you Batman for your help and that code.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
Jason M

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.

<?php the_tags(); ?>

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

Share this post


Link to post
Share on other sites
batman

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 :)


Life is too short to remove USB safely ...

Share this post


Link to post
Share on other sites
Jason M

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.

Share this post


Link to post
Share on other sites
Danny

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


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×