Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #1113498

    Hi guys

    On the blog section below, we’re using the Masonry element. Have set Pagination to ‘Display Pagination’ however when navigating to a post, there is no pagination/navigation at top/bottom or anywhere on the post?

    Is there another setting to enable?

    cheers

    #1113608

    Hey pantoni,

    Thanks for the details, could you post WordPress login details as well please?

    Best regards,
    Rikard

    #1113612

    Hi Rikard

    Here you go – thank you!

    Just so you know – I’ve also just added the Functions.php code supplied by one of your colleagues to display the block at bottom of Posts “You might also like”;
    —————————————————————————
    function related_posts_shortcode( $attr ) {
    ob_start();
    get_template_part( ‘includes/related-posts’ );
    return ob_get_clean();
    }
    add_shortcode( ‘rpost’, ‘related_posts_shortcode’ );
    —————————————————————————

    Cheers

    #1113835

    Hi,

    Thanks for that, you only have 2 posts in that category. There won’t be any pagination unless there are more posts than you have selected, in your case 8.

    Best regards,
    Rikard

    #1113840

    HI Rikard

    I’ve got 4 posts in the blog section now but still not working?
    https://loop2019.wpengine.com/inspire/

    thanks

    #1114079

    Hi pantoni,

    Try adding one or two more and the pagination will show up.

    Best regards,
    Victoria

    #1114140

    Hi Victoria
    I tried around 10 but still no display. Just wondering if I can do the following?….

    Inside the ‘Inspire’ blog section, for each of the Posts, I now have the bottom block working well – “You might also like”, using this functions code:

    ——————————-
    function related_posts_shortcode( $attr ) {
    ob_start();
    get_template_part( ‘includes/related-posts’ );
    return ob_get_clean();
    }
    add_shortcode( ‘rpost’, ‘related_posts_shortcode’ );
    ——————————-
    I would like to display the same block at the bottom of each of the Portfolio items inside the “Projects” section.
    Is this possible??

    Many thanks.

    #1114233

    Hi,

    Thank you for the update.

    You should be able to duplicate that shortcode and use it for your portfolio items. Just replace the “related-posts” with “related-portfolio-posts” so that it displays the correct post type or taxonomy.

    Best regards,
    Ismael

    #1114396

    Hi Ismael
    I duplicated that code and tried a few syntax variations but it either clashed with the existing code, or it removed the related posts block from the Inspire blog section all together.

    1. First code I tried was: duplicate and only changed this line… ‘includes/related-portfolio-posts’ );
    That caused an error
    —————————————
    Your PHP code changes were rolled back due to an error on line 30 of file wp-content/themes/enfold-child/functions.php. Please fix and try saving again.

    Cannot redeclare related_posts_shortcode() (previously declared in wp-content/themes/enfold-child/functions.php:18)

    2. Then tried this code… and removed the Inspire bottom block
    —————————————-
    function related_portfolio_posts_shortcode( $attr ) {
    ob_start();
    get_template_part( ‘includes/related-portfolio-posts’ );
    return ob_get_clean();
    }
    add_shortcode( ‘rpost’, ‘related_portfolio_posts_shortcode’ );
    —————————————
    Would you have the exact full code for this?

    Many thanks

    #1114817

    Hi,

    Thank you for the update.

    You should also adjust the name of the shortcode from “rpost” to something else.

    add_shortcode( ‘rpost’, ‘related_portfolio_posts_shortcode’ );
    

    Change the name of the shortcode tag.

    Best regards,
    Ismael

    #1115000

    Hi Ismael
    Still no luck – I’ve included all the code for both the ‘Inspire’ blog section, and the ‘Projects’ section below. The updated code allows the blog section to display the “You may also like’ block correctly, but NOT for the ‘Projects’ section. I must still have the syntax incorrect???

    —————————————————————————————————————————–
    /* enables Inspire post footer You May Also Like */
    function related_posts_shortcode( $attr ) {
    ob_start();
    get_template_part( ‘includes/related-posts’ );
    return ob_get_clean();
    }
    add_shortcode( ‘rpost’, ‘related_posts_shortcode’ );

    /* enables Projects post footer You May Also Like */
    function related_portfolio_posts_shortcode( $attr ) {
    ob_start();
    get_template_part( ‘includes/related-portfolio-posts’ );
    return ob_get_clean();
    }
    add_shortcode( ‘rpostport’, ‘related_portfolio_posts_shortcode’ );
    —————————————————————————————————————————–
    Thank you.

    #1115775

    Hi,

    Thank you for the update.

    Did you change the shotcode from “[rpost]” to “[rpostport]”? That’s the new name or tag of your shortcode.

    Best regards,
    Ismael

    #1115783

    Hi Ismael
    Yes as you suggested – I changed the shortcode from “[rpost]” to “[rpostport]” as per complete code posted above.

    Then went into a Portfolio item, added a Code element with that shortcode in it, however it only displays the shortcode text [rpostport] instead of the actual content block. You can see that on this example page at the bottom…
    Thanks.

    #1116530

    Hi,

    Thank you for the update.

    I can’t access the site — leads to 401 authentication page. Are you sure that the shortcode isn’t added as text? This usually happens when you add the shortcode in the “Visual” mode of the editor instead of the “Text/HTML” mode.

    Best regards,
    Ismael

    #1116535

    Hi Ismael
    The shortcode is added into a Code Element – same as per the ‘Inspire’ Blog posts. So there is no visual editor. I have tried adding as a Text element but same issue. You can see an example below of using the Code element – at bottom of page it displays the short code text instead of the content block.
    Please

    #1116857

    Hi,

    I can’t access the site as previously stated. The page is asking for a Microsoft authentication and I don’t have any idea where to get it. It redirects to an NGINX 401 Authentication Required page when I cancel the authentication. Can you disable the extra authentication temporarily?

    Best regards,
    Ismael

    #1116867

    Hi Ismael
    Are you talking about this url and details below or WP Admin? It’s working fine here.

    #1117007

    Hi,

    Thanks for the update.

    I forgot to mention that you have to create the includes > related-portfolio-posts.php file manually. After creating the file, use this code.

    // https://pastebin.com/QngXiH7J

    Best regards,
    Ismael

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