[Resolved] Display post categories and tags below title

Home Forums Support [Resolved] Display post categories and tags below title

Home Forums Support Display post categories and tags below title

Viewing 15 posts - 16 through 30 (of 35 total)
  • Author
    Posts
  • #531821
    Leo
    Staff
    Customer Support

    One of the methods here: https://docs.generatepress.com/article/adding-php/

    Code Snippets is the easiest if you aren’t using a child theme.

    #574633
    Michael

    Hi, I tried this code (the first set) and it only moves the categories. Anyway to get the tags to move up under the title as well?

    #574728
    Leo
    Staff
    Customer Support
    #580268
    Michael

    Hi Leo,

    That worked but unfortunately it also put the tags on every single post excerpt in the Tag pages…which, besides looking goofy, is absolutely horrible for SEO. Tag pages are over optimized by nature and injecting this many more keywords is likely to attract a Google algo penalty.

    See here for an example:

    https://foodal.com/tag/potato/

    I don’t want to see category or tag links on blog archives…and I have that turned off in customizer. It is definitely NOT good for SEO…besides the injection of kewyords, it’s diluting the link juice flow to each post. These categories and tags pages need to function as sort of container for a content cluster or silo if that makes sense. All the child pages link back to the parent and the parent links back to the child and that’s it.

    #580284
    Michael

    Ok, I turned off Show Authors on Archives (which really shouldn’t have been on anway) and it did away with the category and tag showing on category and tag pages…so I guess problem solved.

    #580403
    Leo
    Staff
    Customer Support

    Glad you figured out πŸ™‚

    #860452
    Damon

    Hello there

    I am also trying to get categories to show under the title (instead of at the bottom of the page).
    I added this suggestion https://generatepress.com/forums/topic/display-post-categories-and-tags-below-title/#post-443405 using Code Snippets plugin. Which works fine, however the category still shows below the post.

    I would like to remove the ‘category’ and ‘add a comment’ link on the bottom of the excerpt on archives and remove the category from the bottom of the single post.

    If any of you kind people could help me figure it out I would appreciate it.

    #860589
    Damon

    SOLVED: I turned off the categories in the Customizer.

    Thanks for the awesome theme xx

    #860590
    David
    Staff
    Customer Support

    Glad to hear you got it resolved.

    #1008529
    Paul

    So I tried implementing the suggestions from both Leo and Tom and neither works correctly. Leo’s doesn’t format well. Tom’s is missing the icons and also duplicates the cats and tags on the archive page. I’ve googled the forum and this topic has been asked a few times, but all authored solutions don’t have a practical answer. Here’s what people want:

    Move cats and tags to the top of the post, below the title. It should look like the default version normally on the bottom with the icons. Don’t duplicate cats and tags on the archive pages.

    #1008807
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    First, add this function:

    add_filter( 'generate_header_entry_meta_items', function() {
        return array(
            'author',
            'date',
            'categories',
            'tags',
        );
    } );
    
    add_filter( 'generate_footer_entry_meta_items', function( $items ) {
        return array_diff( $items, [ 'categories', 'tags' ] );
    } );

    Then, add this CSS:

    .entry-header .cat-links:before, 
    .entry-header .tags-links:before {
        display: inline-block; /* adds icons */
    }
    
    .entry-header .cat-links, 
    .entry-header .tags-links {
        display: block; /* puts them on their own lines */
    }

    Hope this helps πŸ™‚

    #1008832
    Paul

    It’s beautiful work. Works great. Thank you!

    I used:

    
    add_filter( 'generate_header_entry_meta_items', function() {
        return array(
            'categories',
        );
    } );
    
    add_filter( 'generate_footer_entry_meta_items', function( $items ) {
        return array(
            'date',
            'tags',
            'post-navigation',
        );
    } );
    

    Is there any way that I can style the previous and next post on the very bottom of the post? The text is very small and faint. I wasn’t able to find the css code using chrome inspector.

    #1008970
    Tom
    Lead Developer
    Lead Developer

    You could try this:

    .post-navigation {
        font-size: 20px;
    }

    Feel free to open a new topic if you need more help with that one πŸ™‚

    #1008978
    Paul

    Perfect. I think we can officially mark this thread resolved. Thanks for your help, Tom and the GP Team.

    #1008981
    Tom
    Lead Developer
    Lead Developer

    No problem πŸ™‚

Viewing 15 posts - 16 through 30 (of 35 total)
  • You must be logged in to reply to this topic.