You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi - using msls, i noticed that for paged categories or tags, i am pointed to the start of the category/tag.
example: http://localhost/kategorie/archiv/seite/2/
points to: http://localhost/es/categoria/archivo/
expected link should be: http://localhost/es/categoria/archivo/pagina/2/
Notice, i changed the default wordpress url-term «page» to /seite/ - /pagina/, using a rewrite rule.
I replicated the plugin and for example for archive pages i use:
// is_ES() is a function that checks get_locale()
if (is_ES() == true){
$page = 'seite';
$myblog_id = 1;
} else {
$page = 'pagina';
$myblog_id = 2;
}
if (is_archive()){
$cat_base = get_option('category_base');
switch_to_blog($myblog_id );
//since get_category_link doesn’t work
//properly, (it prints the category base of the
//opposite blog) i’ve taken a different
//approach with str_replace()
//see: https://core.trac.wordpress.org/ticket/48786
$cat_dest = get_option('category_base');
$url_cat = get_category_link(get_query_var( 'cat' ));
//check if it’s paged
if (get_query_var( 'paged' ) > 0){
//adding $page and the number to the url
$cat_switch = str_replace($cat_base, $cat_dest, $url_cat) .$page.'/'.get_query_var( 'paged' ).'/';
} else {
$cat_switch = str_replace($cat_base, $cat_dest, $url_cat);
}
restore_current_blog();
}
This bears the desired link: http://localhost/kategorie/archiv/seite/2/
points to: http://localhost/es/categoria/archivo/pagina/2/
Another incongruence arises, if a developper shows similar posts with pagination in single.php.
To avoid this i suggest something like:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi - using msls, i noticed that for paged categories or tags, i am pointed to the start of the category/tag.
example:
http://localhost/kategorie/archiv/seite/2/
points to:
http://localhost/es/categoria/archivo/
expected link should be:
http://localhost/es/categoria/archivo/pagina/2/
Notice, i changed the default wordpress url-term «page» to /seite/ - /pagina/, using a rewrite rule.
I replicated the plugin and for example for archive pages i use:
This bears the desired link:
http://localhost/kategorie/archiv/seite/2/
points to:
http://localhost/es/categoria/archivo/pagina/2/
Another incongruence arises, if a developper shows similar posts with pagination in single.php.
To avoid this i suggest something like:
How about providing the fitting links for paged archives and paged similar posts in single.php?
regards theo
Beta Was this translation helpful? Give feedback.
All reactions