- This topic has 12 replies, 4 voices, and was last updated 4 years, 5 months ago by
Elvin.
-
AuthorPosts
-
April 13, 2021 at 3:04 pm #1733227
Gian
Dear GP support,
I would like to ask you if it’s possible to move the content for all archive pages (like the one in the tab private information) below the posts belonging to that category.
I’ve tried the solution here https://generatepress.com/forums/topic/content-below-posts-on-category-page/ but is not working on my website.
Also, I already use this snippet https://generatepress.com/forums/topic/remove-category-description-on-page-2-3-etc/#post-547434 to remove the description on the 2nd, 3rd etc page of archive pages.
Thank you in advance!
April 13, 2021 at 3:39 pm #1733249Ying
StaffCustomer SupportHi Gian,
Give this CSS a try:
.archive .page-header { order: 100; }
Let me know 🙂
April 13, 2021 at 3:52 pm #1733257Gian
Hi Ying,
Thank you, it worked but the CSS move also the page title below the posts.
Is there a way to keep the elements in the following order: Page title > posts > archive description ?
April 14, 2021 at 3:52 am #1733712David
StaffCustomer SupportHi there,
Tom provides a PHP Snippet here – that will just move the description below the post loop:
https://generatepress.com/forums/topic/archives-at-the-bottom-of-articles/#post-1184179
April 14, 2021 at 9:51 am #1734406Gian
Excellent, thank you!
April 14, 2021 at 9:55 am #1734415Gian
Hi David, the snippet here https://generatepress.com/forums/topic/archives-at-the-bottom-of-articles/#post-1184179 works, but unfortunately the description on page 2, 3 etc keep showing up, even if I use this snippet https://generatepress.com/forums/topic/remove-category-description-on-page-2-3-etc/#post-547434
Any idea?
Thanks in advance
April 14, 2021 at 7:28 pm #1734753Elvin
StaffCustomer SupportHi there,
That’s strange.
Can you link us to the page in question to check? (Perhaps, backend access as well)
I’ve used this snippet:
add_action( 'wp', function() { remove_action( 'generate_after_archive_title', 'generate_do_archive_description' ); add_action( 'generate_after_main_content', 'generate_do_archive_description' ); } );
And it works well on my sandbox site here: http://elvin.wppluginsupport.net/category/featured/
“This is a test description for Featured category” is the test description and it clearly isn’t showing even on paginated parts.
April 14, 2021 at 8:30 pm #1734780Gian
Hi Elvin, it’s weird, I can see the description “This is a test description for Featured category” here at the bottom http://elvin.wppluginsupport.net/category/featured/page/2/ and here http://elvin.wppluginsupport.net/category/featured/page/3/
Screenshot 1 and 2 https://imgur.com/a/bApt8Rx
April 14, 2021 at 8:44 pm #1734786Elvin
StaffCustomer SupportAh I think I misunderstood what you wanted to do. I may have missed the context as I can’t see what was added on the private information text field because it gets deleted when the post is marked “resolved”.
Did you want to completely remove the title description and NOT add it back below the posts?
If so, do this:
add_action( 'wp', function() { remove_action( 'generate_after_archive_title', 'generate_do_archive_description' ); } );
The line
remove_action( 'generate_after_archive_title', 'generate_do_archive_description' );
removes the category description.The line
add_action( 'generate_after_main_content', 'generate_do_archive_description' );
adds it back after the main content.Maybe I’m still missing the point. Can you clarify? Thank you.
April 15, 2021 at 8:11 am #1735762Gian
Hi Elvin,
I’d like to know how to keep the elements of Archive pages in this order Page title > posts > archive description, and remove archive description only on page 2, 3 etc.
Let me know if you need more information, thank you in advance.
April 15, 2021 at 4:11 pm #1736133Elvin
StaffCustomer SupportAh alright.
If that’s the case, try this PHP snippet:
add_action( 'wp', function() { global $paged; remove_action( 'generate_after_archive_title', 'generate_do_archive_description' ); if($paged == 0){ add_action( 'generate_after_main_content', 'generate_do_archive_description' ); } } );
This checks the pagination. If page is the first page (
($paged == 0)
), it adds the description. else, it won’t add in anything. 🙂April 15, 2021 at 7:38 pm #1736216Gian
Perfect, thank you!
April 15, 2021 at 8:42 pm #1736247Elvin
StaffCustomer SupportNo problem. Glad you got it sorted. 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.