move post meta above post

Community Forums Forums General Discussion move post meta above post

This topic is: not resolved

This topic contains 16 replies, has 3 voices, and was last updated by  SoZo 1 year, 10 months ago.

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #17546

    karlaarcher
    Participant
    Post count: 15

    I’m trying to figure out how to move the post meta (categories and tags) above the post (right below the post info). I’m at a loss. All I’m finding is how to remove it.

    Thanks for any insight!!

    #17592

    Davinder Singh Kainth
    Participant
    Post count: 1451

    Try this in functions.php file

    // post info location change
    remove_action(‘genesis_after_post_content’, ‘genesis_post_meta’);

    add_action(‘template_redirect’, ‘child_conditional_actions’);
    function child_conditional_actions() {
    if( is_single() ) {
    add_action(‘genesis_before_post_title’, ‘genesis_post_meta’);
    }}


    Need website customization services or other Genesis / WordPress help ?
    Davinder @ Design Studio iGuiding Media | My Blog | Fresh Genesis Themes Collection

    #17700

    karlaarcher
    Participant
    Post count: 15

    Thanks, idavinder!

    I tried that (after removing the second } at the end, and it didn’t work — it must be missing something — It breaks the site.

    #17732

    SoZo
    Moderator
    Post count: 1573

    You need the last curly brace so put it back


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #17738

    karlaarcher
    Participant
    Post count: 15

    Thanks, SoZo — I added that back in — have never seen a }} (that I recall). It didn’t break, but it didn’t move it before the post. It’s gone: http://client8.archercreative.com/

    #17741

    SoZo
    Moderator
    Post count: 1573

    You just need to close every opening curly brace. Since there are two you need two closing ones. And it’s there. It’s just that there is a conditional in there: is_single(), so it’s only outputting on the single post page, e.g. http://client8.archercreative.com/archives/84

    If you want to change it everywhere you just need
    [php]remove_action(‘genesis_after_post_content’, ‘genesis_post_meta’);
    add_action(‘genesis_after_post_title’, ‘genesis_post_meta’);[/php]

    And you may need to add in a priority as well since post_info is hooked onto after_post_title as well, e.g.
    [php]add_action(‘genesis_after_post_title’, ‘genesis_post_meta’, 5);[/php]
    To learn about priority numbers and other add_action parameters see this.


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #17743

    karlaarcher
    Participant
    Post count: 15

    ah yes – two conditions. Makes sense.

    I still don’t see the categories, above or below…

    #17745

    SoZo
    Moderator
    Post count: 1573

    What exactly do you have in there now? It’s still showing up above the post title in singel view.


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #17746

    karlaarcher
    Participant
    Post count: 15

    I’m trying to get the post categories before the post not after.

    #17747

    SoZo
    Moderator
    Post count: 1573

    Yes, but you want them below the post title, right?

    What did you add to the functions file after my post? i.e what did you change? I am not seeing any difference. It still shows up above the post title in the single post page, which is where iDavinder’s example would output, not mine.


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #17751

    karlaarcher
    Participant
    Post count: 15

    Yes — I want both below the post title: Post title, post info, post meta

    I only added the code that iDavinder posted above. I didn’t remove or add anything else.

    #17752

    karlaarcher
    Participant
    Post count: 15

    maybe I have something else in my functions that is overriding it?

    #17753

    SoZo
    Moderator
    Post count: 1573

    Remove what iDavinder posted and replace it with what I posted in my second response.

    Wait, how are the posts on the home page being output?


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    #17760

    karlaarcher
    Participant
    Post count: 15

    I added

    remove_action(‘genesis_after_post_content’, ‘genesis_post_meta’);
    add_action(‘genesis_after_post_title’, ‘genesis_post_meta’);

    add_action(‘genesis_after_post_title’, ‘genesis_post_meta’, 5);

    and it’s still at the bottom of the posts.

    (I appreciate your help SoZo!!)

    #17914

    SoZo
    Moderator
    Post count: 1573

    You don’t add the add_action twice. You only need
    [php]remove_action(‘genesis_after_post_content’, ‘genesis_post_meta’);
    add_action(‘genesis_after_post_title’, ‘genesis_post_meta, 5 ’);[/php]

    And you’ll need to play with the priority number. But there is another issue with the home page since the post meta isn’t showing anywhere.


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

Viewing 15 posts - 1 through 15 (of 17 total)

The topic ‘move post meta above post’ is closed to new replies.