- This topic has 11 replies, 3 voices, and was last updated 6 years, 1 month ago by Leo.
-
AuthorPosts
-
February 5, 2018 at 11:47 am #488738James
Hi Tom,
I assume the answer is using CSS what I’m not sure is how to code it.
What I am trying to achieve is to have the following on my single blog post page in this order:
Breadcrumbs (check this is appearing first)
Feature Image (check this is showing second)
Category
Post Title
Author
Post DateUltimately it would be great on the last two to have it show as follows assuming I’m author and date is today:
by James Peter | Published February 5th, 2018
Today I am seeing all these elements except the category and currently it shows date then author.
Is there a way or method to change the order and show the category under the image prior to title?
Thanks in advance for your guidance on this.
James
February 5, 2018 at 3:27 pm #488912LeoStaffCustomer SupportHi James,
Can you link us to to what you currently have?
Thanks!
February 5, 2018 at 10:55 pm #489109JamesAbsolutely Leo is there a way I submit that to you other than pasting link in this message?
February 5, 2018 at 11:21 pm #489118TomLead DeveloperLead DeveloperIf you edit your original post, you’ll see a website URL field. Only us admins can see it, so your URL will stay private ๐
February 6, 2018 at 5:45 am #489356JamesTom thank you I have edited the original post and added the link.
For now I have the title appearing above the picture I am comfortable with how to move it below the picture hoping to place the category under the image before author and date
As well in a prior post I asked about adding breadcrumbs with Yoast and it worked but now wonder (as you’ll see) how to move it from the top of the page below the image?
Sorry if I’ve asked this additional question in the wrong place I can repost the question on that original post if you prefer.
I appreciate all the help
James
February 6, 2018 at 9:13 pm #490076TomLead DeveloperLead DeveloperHey James,
So you’re wanting the categories to move from below the post to below the featured image?
I’m not seeing breadcrumbs at all – how are you currently adding them?
February 9, 2018 at 2:07 pm #492534JamesHi Tom sorry for the delayed response. In a separate thread I have been working with Leo regarding the breadcrumbs he has provided me php code to be used in the hooks section which worked, then didn’t and this weekend with new code expect it will … I too saw that the breadcrumbs went away.
I also didn’t realize the category showed at the bottom of the post (I assume that is where there is an icon then the category name)?
My hope was to show the category the post belonged to under the picture yes and (now after seeing how it appears) hoping to drop the icon and change the size/color if needed (I assume css for that).
I hope everything above makes sense thanks.
James
February 9, 2018 at 9:01 pm #492687TomLead DeveloperLead DeveloperHi James,
Should be pretty easy!
First, disable the categories in Customize > Layout > Blog.
Then, add this PHP snippet:
add_action( 'generate_after_entry_header', 'tu_cats_after_image', 20 ); function tu_cats_after_image() { $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'generatepress' ) ); if ( $categories_list ) { printf( '<span class="cat-links"><span class="screen-reader-text">%1$s </span>%2$s</span>', // WPCS: XSS ok, sanitization ok. esc_html_x( 'Categories', 'Used before category names.', 'generatepress' ), $categories_list ); } }
Let me know if this does it or not ๐
February 17, 2018 at 8:56 am #498952JamesThanks Tom where do I add the PHP snippet please?
February 17, 2018 at 9:09 am #498971LeoStaffCustomer SupportOne of these methods here: https://docs.generatepress.com/article/adding-php/
Code Snippets is the easiest if you aren’t using a child theme.
February 19, 2018 at 4:12 pm #500657JamesThanks Leo, seems the reviews recently on Code Snippets aren’t too favorable might try as I know nothing about php (other than I think I should probably take some time to learn the basics).
As it relates to child theme do you recommend doing one and if so what is the best way to create child theme for GP+
Part of why I went with GP+ was somewhere I had read child theme wasn’t necessary (which I understand if I’m adding lots of custom code makes sense to have a child)
James
February 19, 2018 at 10:31 pm #500823LeoStaffCustomer SupportYou can see more on child theme and download one here: https://docs.generatepress.com/article/using-child-theme/
It’s definitely not necessary. I personally prefer Code Snippets. It doesn’t(usually) makes your site crash…
-
AuthorPosts
- You must be logged in to reply to this topic.