Site logo

[Resolved] Move content below posts in Archive pages

Home Forums Support [Resolved] Move content below posts in Archive pages

Home Forums Support Move content below posts in Archive pages

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #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!

    #1733249
    Ying
    Staff
    Customer Support

    Hi Gian,

    Give this CSS a try:

    .archive .page-header {
        order: 100;
    }

    Let me know 🙂

    #1733257
    Gian

    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 ?

    #1733712
    David
    Staff
    Customer Support

    Hi 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

    #1734406
    Gian

    Excellent, thank you!

    #1734415
    Gian

    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

    #1734753
    Elvin
    Staff
    Customer Support

    Hi 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.

    #1734780
    Gian

    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

    #1734786
    Elvin
    Staff
    Customer Support

    Ah 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.

    #1735762
    Gian

    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.

    #1736133
    Elvin
    Staff
    Customer Support

    Ah 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. 🙂

    #1736216
    Gian

    Perfect, thank you!

    #1736247
    Elvin
    Staff
    Customer Support

    No problem. Glad you got it sorted. 🙂

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.