Community Forums › Forums › General Discussion › move post meta above post
This topic contains 16 replies, has 3 voices, and was last updated by SoZo 3 months, 1 week ago.
-
AuthorPosts
-
February 2, 2013 at 10:29 pm #17546
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!!
February 3, 2013 at 7:24 am #17592Try 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’);
}}
February 3, 2013 at 4:51 pm #17700Thanks, 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.
February 3, 2013 at 8:04 pm #17732You need the last curly brace so put it back
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
February 3, 2013 at 8:13 pm #17738Thanks, 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/
February 3, 2013 at 8:19 pm #17741You 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
remove_action(‘genesis_after_post_content’, ‘genesis_post_meta’); add_action(‘genesis_after_post_title’, ‘genesis_post_meta’);
And you may need to add in a priority as well since post_info is hooked onto after_post_title as well, e.g.
add_action(‘genesis_after_post_title’, ‘genesis_post_meta’, 5);
To learn about priority numbers and other add_action parameters see this.
John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography
February 3, 2013 at 8:35 pm #17743ah yes – two conditions. Makes sense.
I still don’t see the categories, above or below…
February 3, 2013 at 8:42 pm #17745What 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
February 3, 2013 at 8:43 pm #17746I’m trying to get the post categories before the post not after.
February 3, 2013 at 8:45 pm #17747Yes, 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
February 3, 2013 at 8:49 pm #17751Yes — 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.
February 3, 2013 at 8:49 pm #17752maybe I have something else in my functions that is overriding it?
February 3, 2013 at 8:50 pm #17753Remove 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
February 3, 2013 at 9:07 pm #17760I 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!!)
February 4, 2013 at 11:04 am #17914You don’t add the add_action twice. You only need
remove_action(‘genesis_after_post_content’, ‘genesis_post_meta’); add_action(‘genesis_after_post_title’, ‘genesis_post_meta, 5 ’);
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
-
AuthorPosts
The topic ‘move post meta above post’ is closed to new replies.