Tagged: , ,

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #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.

    #1193650

    Hey seb332,

    Best regards,
    Victoria

    #1193662

    No. See the private picture for more info.

    #1193798

    I’m using the last version.

    #1194112

    Hi,
    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,
    Mike

    #1194122

    Hi,
    Unfortunetly, this fix isn’t working. (even after remove the cache).

    I have tried in an other browser too.

    #1194381

    Hi,
    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,
    Mike

    #1194511

    I’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.

    #1194591

    Hi 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,
    Victoria

    #1194596

    yes.

    #1194792

    Hi,
    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,
    Mike

    #1194795
    #1195044

    Hi,
    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">
    2020-03-21_054411.png
    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">
    2020-03-21_054606.png
    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.
    2020-03-21_060712.png
    I hope I have explained this well.

    Best regards,
    Mike

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