Community Forums › Forums › Archived Forums › General Discussion › move post meta above post
- This topic has 16 replies, 3 voices, and was last updated 11 years, 1 month ago by SoZo.
-
AuthorPosts
-
February 2, 2013 at 10:29 pm #17546karlaarcherMember
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!!
Karla Archer
archercreative.comFebruary 3, 2013 at 7:24 am #17592Davinder Singh KainthMemberTry 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');
}}
Sunshine PRO genesis theme
Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis ThemesFebruary 3, 2013 at 4:51 pm #17700karlaarcherMemberThanks, 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.
Karla Archer
archercreative.comFebruary 3, 2013 at 8:04 pm #17732SoZoMemberYou 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 #17738karlaarcherMemberThanks, 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/
Karla Archer
archercreative.comFebruary 3, 2013 at 8:19 pm #17741SoZoMemberYou 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 #17743karlaarcherMemberah yes - two conditions. Makes sense.
I still don't see the categories, above or below...
Karla Archer
archercreative.comFebruary 3, 2013 at 8:42 pm #17745SoZoMemberWhat 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 #17746karlaarcherMemberFebruary 3, 2013 at 8:45 pm #17747SoZoMemberYes, 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 #17751karlaarcherMemberYes -- 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.
Karla Archer
archercreative.comFebruary 3, 2013 at 8:49 pm #17752karlaarcherMemberFebruary 3, 2013 at 8:50 pm #17753SoZoMemberRemove 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 #17760karlaarcherMemberI 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!!)
Karla Archer
archercreative.comFebruary 4, 2013 at 11:04 am #17914SoZoMemberYou 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
February 4, 2013 at 11:28 am #17922karlaarcherMemberThanks SoZo -- I ended up putting [post_categories] [post_tags] in the post info.
I then, to the CSS, I added:
.post-info .categories, .post-meta .tags {
display: block;
padding: 0;
}Issue solved. I was totally over thinking this... (as usual...)
Thanks for the help and patience, y'all!
Karla Archer
archercreative.comFebruary 4, 2013 at 2:12 pm #17975SoZoMember -
AuthorPosts
- The topic ‘move post meta above post’ is closed to new replies.