- This topic has 7 replies, 2 voices, and was last updated 2 years, 5 months ago by Ying.
-
AuthorPosts
-
October 4, 2021 at 10:24 am #1952451Alan
I have been eliminating a lot of redundant and unnecessary code, and it looks like my blog got messed up somehow. Please help me with the following:
For the blog page, I want the post date, by line, and categories showing underneath the title (which is how it currently displays). The problem that I have is that the category also displays below the meta items on the blog post. I do not know how to remove this. You can see my blog settings here https://www.savacations.com/wp-content/uploads/2021/10/Blog-Page-Setup.jpg
Additionally, the search icon widget is showing on two lines and I don’t know how to fix it.
For the single posts, everything is mostly fine, but the categories are appearing on the meta line below the title (as I want it) and at the bottom of the post above the tags (which I don’t want). See here for an example https://www.savacations.com/where-to-stay-in-santiago-chile-centro-providencia-or-las-condes/.
For the archives (author, category, and tag), it’s the same as the blog page above. See here for an example https://www.savacations.com/category/south-america-travel/.
I am using the following snippets that I got from this forum over time…
For the archive pages
add_filter( 'generate_header_entry_meta_items', function() { return array( 'date', 'author', 'categories', ); } );
For the single posts
// set entry header post meta add_action( 'wp', function() { if ( is_single() ) { add_filter( 'generate_header_entry_meta_items', function( $items ) { return array( 'date', 'author', 'categories', ); } ); } } );
I tried to use the option_generate_blog_settings (which may fix all of my problems) but got an error on line 3 code see here https://www.savacations.com/wp-content/uploads/2021/10/Option-Generate-Blog-Settings.jpg
Thanks,
October 4, 2021 at 11:12 am #1952496YingStaffCustomer SupportHi Alan,
The problem that I have is that the category also displays below the meta items on the blog post. I do not know how to remove this
Your screenshot shows the Display Categories box is checked, you just need to uncheck it:
https://www.screencast.com/t/f0sAiWmMfNthe search icon widget is showing on two lines
It’s caused by this CSS, can you check if you added it anywhere in your site?
https://www.screencast.com/t/42WZyCrZ9October 4, 2021 at 12:04 pm #1952550AlanIf I uncheck the categories box, it disappears everywhere. See here https://www.savacations.com/wp-content/uploads/2021/10/Unchecked-categories-box.jpg.
Any reason I am getting an error message on line 3 for the generate_blog_settings snippet?
Also, if I remove that css, it affects the trustpilot box on this and all itineraries https://www.savacations.com/tours/quito-8-day-galapagos-seaman-journey-cruise-northern-southern-islands/ (see below the Why Book with Us? widget box on right hand side).
October 4, 2021 at 12:59 pm #1952599YingStaffCustomer SupportIf I uncheck the categories box, it disappears everywhere.
I see, then add this snippet as well:
add_filter( 'generate_footer_entry_meta_items', function() { return ''; } );
Any reason I am getting an error message on line 3 for the generate_blog_settings snippet?
I don’t seem to see an error, it looks right to me. Can you copy and paste the entire code snippet here?
I’m not sure this CSS affects the link you shared at all, since this page is set to
no sidebar
, I don’t see thesidebar
class on this page:.sidebar .widget :last-child { margin-bottom: 1.5em; }
October 4, 2021 at 1:26 pm #1952616AlanThis is the code snippet…
add_filter( 'option_generate_blog_settings', 'lh_custom_search_results_page_settings' ); function lh_custom_search_results_page_settings( $options ) { if ( is_search() ) { $options['read_more_button'] = true; $options['date'] = true; $options['categories'] = true; $options['tags'] = true; $options['comments'] = false; $options['infinite_scroll'] = true; $options['infinite_scroll_button'] = true; $options['masonry_load_more'] = 'More search results'; $options['post_image'] = true; $options['post_image_position'] = 'post-image-above-header'; $options['post_image_alignment'] = 'post-image-aligned-center'; $options['column_layout'] = false; $options['featured_column'] = true; $options['masonry'] = false; } return $options; }
October 4, 2021 at 1:57 pm #1952638YingStaffCustomer SupportJust tested this code on 3 or my sites, all of them are activated successfully.
https://www.screencast.com/t/Mt5TupKuW8wCan not replicate this issue on my side.
Can you try disable all other plugins except GP premium to test?
Let me know 🙂
October 5, 2021 at 12:17 pm #1953837AlanOk, I will need to speak with my developer about these issues…
Thanks,
October 5, 2021 at 12:28 pm #1953852YingStaffCustomer SupportNo problem 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.