Community Forums › Forums › Archived Forums › Design Tips and Tricks › Post Meta on Top Of .site-inner
Tagged: categories, functions.php, post meta
- This topic has 11 replies, 3 voices, and was last updated 9 years, 6 months ago by Brad Dalton.
-
AuthorPosts
-
June 4, 2015 at 7:36 am #154846itzsniderParticipant
All,
I am trying to mimic the below photo
https://www.dropbox.com/s/ovvmt7lmpthl6q9/2015-06-04%2009_23_00-Hangouts.png?dl=0
See how it shows "geek" as the category "attached" to the content. I LOVE this look and think it would look great on my site.
Currently I only have this in functions.php
//* Customize the post meta function add_filter( 'genesis_post_meta', 'sp_post_meta_filter' ); function sp_post_meta_filter($post_meta) { if ( !is_page() ) { $post_meta = '[post_categories before="Filed Under: "] [post_tags before="Tagged: "]'; return $post_meta; }
So I assume I need to somehow push the [post_categories before="Filed Under: "] to above the post area some how.
Any ideas on where I should start hunting and pecking?
http://www.geekdaily.co/kick-ass-superhero-alphabet/June 4, 2015 at 7:53 am #154850Erik D. SlaterMemberIf you want to move the category to the top of an article/above the article title, this could be achieved with CSS:
(1) ensure the article container has position: relative;
(2) the categories container (if you have one) could be set to position: absolute;top: 0;Something along those lines anyway ...
Erik D. Slater: Digital Platform Consultant • LinkedInJune 4, 2015 at 8:09 am #154852itzsniderParticipantThat works BUT technically it's still part of the entry-content when I need it pinned to the left side of the .full-width-content .content
Here is what it looks like now
How do I get it to be part of the full width content rather than the entry-content? Make sense?
If I do something like margin-left: -200px; it works but will that show properly on mobile as well?
June 4, 2015 at 10:35 am #154864itzsniderParticipantWould something like this work?
I assume I have to put this after the header
//* Customize the post meta function add_filter( 'genesis_after_header', 'genesis_post_meta' ); function genesis_post_meta($post_meta) { if ( !is_page() ) { $post_meta = '[post_categories before="Filed Under: "]'; return $post_meta; }}
And then I could style it?
Or is it as simple as saying
add_action( 'genesis_after_header', 'post_categories' )
?June 5, 2015 at 5:39 am #154972itzsniderParticipantAnyone able to lend a hand here?
June 6, 2015 at 9:59 am #155111itzsniderParticipantWhat am I missing here?
My whole Functions.php is here - http://pastebin.com/yQhnLC3J
I removed this code
//* Customize the post meta function add_filter( 'genesis_post_meta', 'sp_post_meta_filter' ); function sp_post_meta_filter($post_meta) { if ( !is_page() ) { $post_meta = '[post_categories before="Filed Under: "] [post_tags before="Tagged: "]'; return $post_meta; }}
and then I added this code
remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); add_action( 'genesis_after_header', 'genesis_post_meta' );
then it broke my site.... must be missing something small
June 6, 2015 at 9:59 am #155112Brad DaltonParticipantTested and does exactly what you want.
remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); add_action( 'genesis_after_header', 'genesis_post_meta' );
Using a code editor to paste this at the end of your functions file.
June 6, 2015 at 10:02 am #155114itzsniderParticipantI added it to the bottom and it brings the site white. Must be missing something.
June 6, 2015 at 10:14 am #155116Brad DaltonParticipantDid you use a code editor or the theme editor in WordPress?.
Whats the error message? Also, link to the site please.
June 6, 2015 at 10:18 am #155117itzsniderParticipantFor some reason this needs to be the last code
/* Helps to remove ? content for pageload function _remove_script_version( $src ){ $parts = explode( '?ver', $src ); return $parts[0]; } add_filter( 'script_loader_src', '_remove_script_version', 15, 1 ); add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
It now works, now to style it and remove tags from showing!!
Thanks Brad!!
June 6, 2015 at 10:28 am #155121itzsniderParticipantNow to put that only on single pages?
Hmmm everything is a learning item, LOVE THIS STUFF!!
June 6, 2015 at 11:08 am #155123 -
AuthorPosts
- The topic ‘Post Meta on Top Of .site-inner’ is closed to new replies.