Site logo

[Support request] Add second button to list post + display custom list post after main content

Home Forums Support [Support request] Add second button to list post + display custom list post after main content

Home Forums Support Add second button to list post + display custom list post after main content

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2562811
    Michele

    Hi everyone,
    I’m trying to figure out how to insert a second button on specific list post based on tag. What I want to get is something like this:
    two button on post list

    After that I want to show custom post list (with the two buttons) at the and of specific post, with this layout from mobile: example

    Can you please help me?

    Thank you so much!

    #2562877
    David
    Staff
    Customer Support

    Hi there,

    how is the list being displayed ? Is it using the GenerateBlocks Query Loop block ?

    #2562897
    Michele

    Hi David,
    I need it for category post list and also for GenerateBlocks Query Loop.

    Thank you!

    #2563245
    David
    Staff
    Customer Support

    Not easy 🙂
    Can you build the design as you want it for mobile?
    Then we can look at how to move the image to the left on wider screens – which will take CSS

    #2565751
    Michele

    Hi David,
    I’m trying to insert the second button after the “read more” button. I tried this code and it works but it puts the second button outside the “read-more-container” paragraph.

    add_action( 'generate_after_content', function() {
        $button_label = get_post_meta( get_the_ID(), 'your_button_custom_field_name', true );
        $button_link = get_post_meta( get_the_ID(), 'your_button_link_custom_field_name', true );
        echo '<a class="button" href="' . $button_link . '">' . $button_label . '</a>';
    } );

    This way I can’t show the two buttons in line with the “display” attribute. How can I fix?

    Here’s the link to the archive page in question: https://migliorcarta.it/category/revolut-bank-uab/

    #2566268
    David
    Staff
    Customer Support

    You can use the generate_content_more_link_output filter.
    See here:

    https://docs.generatepress.com/article/generate_content_more_link_output/

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