Tagged: 

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1035155

    Hello,

    I’m trying to get better SEO on my blog page but it seems like Yoast and Enfold doesn’t work properly together with all the stuff around pagination.

    I want to add rel=”next” rel=”prev” to all the paginations on my site, Yoast should do this automatically according to their website but it doesn’t work. I already tried this : https://kriesi.at/support/topic/paginated-pages-not-showing-relnext-and-relprev/#post-873990

    I want my page title to contain the page number which I should be able to add by adding %%page%% to Yoast configuration on the blog page but it doesn’t work. It seems like for Yoast we are always on page 1.

    Can you look into it please ?

    #1035216

    I have fixed the problem by rewritting avia_pagination function and adding a filter to the title. But Yoast should be fully supported on those things, having to do some hacky stuff for this is not normal.

    #1035730

    Hi AdrienCall,

    Glad you got it working for you! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1176909

    Hi this still isn’t working as of Enfold 4.7.1 and Yoast 12.2

    If I add the %%pagenumber%% variable in my yoast page title settings, this should show in the title as 1 for blog/page/1 , 2 for blog/page/2 etc (where blog is a page set as my posts page in the theme appearance options). but %%pagenumber%% always shows as 1

    if i use the %%page% variable Yoast should output Page 2 of 4 etc for any page greater than 1 … but it’s always blank.
    (since pagenumber is always calculated as 1 and Yoasts skips showing page 1 of 4 )

    thanks
    J

    #1177981

    Hi,

    Thank you for chiming in.

    The theme add its own title tag in the header using the avia_set_title_tag function, and it probably overrides the plugin. If you want to override it, use the avf_title_tag filter. The function can be found in the themes\enfold\framework\php\function-set-avia-frontend.php file.

    Best regards,
    Ismael

    #1177985

    Sorry I may not have explained properly there

    the Yoast title works fine except the page number.. this variable %%pagenumber%% should pick up the number from /page/2 but it’s always 1 not 2

    I think it seems to be an issue with the Enfold implementation of pagination running through template-builder.php

    I have a page /articles with the Avia Builder on it with some content at the top and the Blog Posts component included

    because it’s not running through archive.php the page number is not picked up for /page/2

    I believe this is discussed here:
    https://codex.wordpress.org/Pagination

    Adding the “Paged” Parameter to a Query
    If WP_Query is altering the main loop and the “paged” parameter is not set you’ll need to add it with get_query_var(). This is so WordPress knows exactly what page it’s on.

    and here
    https://wordpress.stackexchange.com/questions/120407/how-to-fix-pagination-for-custom-loops

    thanks

    #1178549

    Hi,

    Thank you for the update.

    The %%pagenumber%% string should be set in the title tag, not in the pagination. The plugin will then convert it to the current value of the page/paged query or the pagination, which should be available when you use the Blog Posts element. Now, this is probably not working because the theme overrides the title tag as explained previously.

    should pick up the number from /page/2 but it’s always 1 not 2

    Where can we check the issue? Do you see different set of items when you use the pagination?

    Best regards,
    Ismael

    #1178567

    “Do you see different set of items when you use the pagination?”

    Yes. but the page number picked up by Yoast is always 1. I’ll post a private link with this reply

    for our /articles/page/2/ on the demo site I’ve included it should be showing in the title Articles (page: Page 2 of 2)(pagenumber: 2) at the beginning of the title but it’s showing (page: )(pagenumber: 1)

    that pagenumber at the end should be 2

    (this is likely because it’s not an archive page as such. it’s a custom page with blog content on it, but the paging isn’t implemented by the builder template)

    thanks

    #1178607

    Hi,

    Thank you for the info.

    Is there any way we can access the site? Please create a new thread/ticket and post the necessary details in the private field. Meanwhile, try to upgrade the theme from v4.4.1 to v4.7.2.

    Best regards,
    Ismael

    #1178716
    This reply has been marked as private.
    #1179330

    Hi,

    Thank you for the access.

    We added the following snippet in the functions.php file to override the default %%pagenumber%% value and it seems to be working as expected. Unfortunately, some of the custom variables like %%pagetotal%% are still not returning the correct output. You may need to include your own implementation in the filter.

    function avf_filter_wpseo_replacements( $replacements ) {
        $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
        if( isset( $replacements['%%pagenumber%%'] ) ){
            $replacements['%%pagenumber%%'] = $page;
        }
        return $replacements;
    };
    
    add_filter( 'wpseo_replacements', 'avf_filter_wpseo_replacements', 10, 1 );
    

    Best regards,
    Ismael

    #1179567
    This reply has been marked as private.
    #1180189

    Hi,

    Sorry about that. We moved it in the private field.

    For the %%pagetotal%% placeholder, try to get the post_count from the WP Query, then divide it with the number of post items displayed in a single page. That should get you the total number of pages.

    // https://wordpress.stackexchange.com/questions/31254/get-post-count-of-current-loop-when-using-multiple-queries-on-one-page

    Best regards,
    Ismael

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