Community Forums › Forums › Archived Forums › Design Tips and Tricks › How to move the post meta to the front of the breadcrumb output?
- This topic has 9 replies, 4 voices, and was last updated 9 years, 1 month ago by Satrap.
-
AuthorPosts
-
January 7, 2015 at 11:56 am #136295SatrapMember
Hi everyone,
Happy new year!
I only use date in my post meta. Like this: Updated on: January 5, 2015
That sits below the post title.
I am trying to move it next to the breadcrumb.
The breadcrumb is located above the title and in a box on the left side, and so I would like to have the post date displayed on the right side within the same box.
Here is a picture to show you exactly what I am talking about: http://postimg.org/image/44wrwfypd/
Is there anyway to do this?
Thank you so much in advance.
http://moneypantry.com/January 7, 2015 at 11:34 pm #136334Brad DaltonParticipantJanuary 27, 2015 at 10:50 pm #138812SatrapMemberHi Brad,
Thanks so much for taking time to help, and I am very sorry for my very late reply. I totally forgot to check back here (from now on I will subscribe).
I read your post, and with my limited knowledge, I gather you mean to basically use a filter to customize the output of the Breadcrumb by basically including the post meta data in it.
Now I am sure this is not correct, but thats the only thing I could come up with which is to add the code for the post info with
the "$args['suffix']" as a new filter.Like so
add_filter( 'genesis_breadcrumb_args', 'child_theme_breadcrumb_modifications' ); function child_theme_breadcrumb_modifications( $args ) { $args['suffix'] = 'Updated on: ' .the_modified_date('F j, Y', '', '', false)</div></div>'; return $args; }
But it doesn't work and I get the error of having an unexpected " ' ".
Is that what you mean or am I doing it completely wrong?
Thanks again and sorry for being a total novice.
January 28, 2015 at 8:41 pm #138910Lauren @ OnceCoupledMemberLook at Brad's article, his header "Reposition Breadcrumbs Using Genesis Hooks". I would recommend using that strategy. Remove your metadata from the current location and hook it in right after the breadcrumbs -- then you'll probably need to make some modifications to your style sheet.
Best,
Lauren
We create mobile-first, PageSpeed-optimized, pixel-perfect custom themes! https://www.oncecoupled.com
January 28, 2015 at 10:57 pm #138929SatrapMemberThanks Lauren.
That is exactly what I was trying to do, but I just can't get it to work. I know the issue is me not knowing how to hook the item correctly, but can't figure out how to do it correctly.
Thanks once again.
January 29, 2015 at 6:36 am #138945Lauren @ OnceCoupledMemberHave you tried using the Genesis Visual Hook Guide plugin with your theme?
We create mobile-first, PageSpeed-optimized, pixel-perfect custom themes! https://www.oncecoupled.com
January 29, 2015 at 9:16 pm #139008SatrapMemberHi Lauren,
I can figure out the hooks and their locations, but I guess what I am confused about/ or are going wrong about it totally is...
Well, let me show you what I came up with first:
// Reposition the post info function remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); add_action( 'genesis_before_loop', 'genesis_post_info' );
And this is the closest I am able to get. But I guess my mistake was in that I thought there would be a way to hook the post info right after the Breadcrumbs by using something like this:
add_action( 'genesis_after_breadcrumbs', 'genesis_post_info' );
But this obviously doesn't work. I am assuming there is no such thing as "genesis_after_breadcrumbs". Is that correct?
And am I correct in assuming that the first code above is the closest I can get to positioning the post info next to the breadcrumb, and from there I have to use CSS to basically move it closer to the breadcrumb output and position the post info on the right side of it?
Thanks once again for taking time to help.
January 31, 2015 at 9:02 am #139167Lauren @ OnceCoupledMemberSorry for the late reply -- yes, what you've said about sounds about right to me.
We create mobile-first, PageSpeed-optimized, pixel-perfect custom themes! https://www.oncecoupled.com
January 31, 2015 at 9:09 am #139170Genesis DeveloperMemberTry this
add_filter( 'genesis_breadcrumb_args', 'child_theme_breadcrumb_modifications' ); function child_theme_breadcrumb_modifications( $args ) { $args['suffix'] = 'Updated on: ' . the_modified_date('F j, Y', '', '', false) . '</div></div>'; return $args; }
You did not add
.'
after the functionthe_modified_date('F j, Y', '', '', false)
and for this reason your are getting the error message.
February 21, 2015 at 9:26 pm #141696SatrapMemberThanks so much for this, and sorry for my very late reply. I had given up on this since I thought there was no way.
I did as you suggested, but sadly its not working. I don't get any errors since you fixed my coding mistake, but it doesn't display the post info in front of the breadcrumb output either.
Any other ideas?...
Thanks once again.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.