Tagged: Yoast
-
AuthorPosts
-
November 19, 2018 at 12:48 pm #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 ?
November 19, 2018 at 5:09 pm #1035216I 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.
November 20, 2018 at 6:40 pm #1035730Hi AdrienCall,
Glad you got it working for you! :)
If you need further assistance please let us know.
Best regards,
VictoriaJanuary 21, 2020 at 7:26 pm #1176909Hi 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
forblog/page/1
,2
forblog/page/2
etc (whereblog
is a page set as myposts page
in the theme appearance options). but%%pagenumber%%
always shows as 1if i use the
%%page%
variable Yoast should outputPage 2 of 4
etc for any page greater than 1 … but it’s always blank.
(sincepagenumber
is always calculated as 1 and Yoasts skips showingpage 1 of 4
)thanks
JJanuary 24, 2020 at 5:17 am #1177981Hi,
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,
IsmaelJanuary 24, 2020 at 5:50 am #1177985Sorry 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 2I 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 theBlog Posts
component includedbecause 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/PaginationAdding 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-loopsthanks
January 27, 2020 at 3:15 am #1178549Hi,
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,
IsmaelJanuary 27, 2020 at 5:46 am #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 titleArticles (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
January 27, 2020 at 9:16 am #1178607Hi,
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,
IsmaelJanuary 27, 2020 at 3:16 pm #1178716This reply has been marked as private.January 29, 2020 at 9:48 am #1179330Hi,
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,
IsmaelJanuary 29, 2020 at 9:04 pm #1179567This reply has been marked as private.January 31, 2020 at 9:39 am #1180189Hi,
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.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.