Tagged: next, pagination, prev
-
AuthorPosts
-
March 16, 2020 at 6:58 pm #1193568
Hi,
As you can see in the source code of this blog (link in private), there as are next and prev links in the header of a post. How can I remove properly just for the posts. (not hidding them with display none). Those links are useless, because, they make link with unsimilar posts (based only of the date of posting).
I have tried to disable the pagination in posts with setting of Enfold without success.
Best regards.
March 16, 2020 at 9:25 pm #1193650Hey seb332,
Best regards,
VictoriaMarch 16, 2020 at 9:51 pm #1193662No. See the private picture for more info.
March 17, 2020 at 2:08 pm #1193798I’m using the last version.
March 18, 2020 at 2:01 pm #1194112Hi,
Thank you for the link to your post, to remove the “next” & “prev” on your single posts, Try adding this code to the end of your functions.php file in Appearance > Editor:function custom_script(){ ?> <script> (function($){ $(document).ready(function(){ $("#top.single-post").each(function() { $('link[rel="next"]').remove() $('link[rel="prev"]').remove() }); }); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_script');
Best regards,
MikeMarch 18, 2020 at 2:42 pm #1194122Hi,
Unfortunetly, this fix isn’t working. (even after remove the cache).I have tried in an other browser too.
March 19, 2020 at 12:06 pm #1194381Hi,
When you check to see if the script is working are you looking at the “page source code” or are you looking at the “Dev Tools Inspector”?
The “page source code” will still show it there, such as in your screenshot, but that is not what the “Google Bot” will see, the Google Bot sees the page after the DOM has been executed, which is what the “Dev Tools” shows when you right-click on the page and choose “inspect” or F12 on a Windows keyboard.Best regards,
MikeMarch 19, 2020 at 6:49 pm #1194511I’ve check the code of the post an other time today.
The fix dosen’t change anything.
The next and prev code is still in the code of the post.
For the moment, I have deleted the fix until a new one found.
Note : I’ve modified the functions.php of my child theme to test your fix.
March 19, 2020 at 9:14 pm #1194591Hi seb332,
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
You can disable post navigation in the theme options.
Best regards,
VictoriaMarch 19, 2020 at 9:21 pm #1194596yes.
March 20, 2020 at 1:45 pm #1194792Hi,
Do you have a custom login url? The normal login “/wp-admin/” is leading to a “404” page.
Or do we need to login from a certain country IP?Best regards,
MikeMarch 20, 2020 at 2:04 pm #1194795March 21, 2020 at 12:35 pm #1195044Hi,
Thank you for the login, I added the script to your functions.php for you, and I took screenshots of before and after for you to show it is working.
Here is before, note the “next” & “prev” code<link rel="next"
is after the<link rel="https://api.w.org/"
and before<meta name="generator" content="WordPress 5.3.2">
Here is after with the script working, notice there is nothing between<link rel="https://api.w.org/"
and<meta name="generator" content="WordPress 5.3.2">
Please note that this removal is preformed in the DOM and can be seen with the DevTools (or inspector), if you try to view with the page “source code” the code will still show because you are viewing the source code pre DOM, which is not what browsers or bots are actually reading.
I hope I have explained this well.Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.