Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1306100

    Hi,
    I found mamy posts about changing “Blog -Latest news” name or hide it or link to a post title.
    But I’d like to leave it as it is, but change the site where it linking to.
    How to do it?

    Regards!

    #1306514

    Hey kwlodar,
    Thank you for your patience, when you say:

    change the site where it linking to

    do you mean redirect to a different domain, or do you mean change the page on the same site?
    To change the page on the same site please adjust the Theme Options:
    Enfold_Theme_Options--And_where_do_you_want_to_display_the_Blog.jpg
    If you want to change the url of the link only for the title, perhaps to a different domain, then try adding this code to the end of your functions.php file in Appearance > Editor:

    function custom_script() { ?>
        <script>
    (function($){
    $(".main-title > a[href^='https://kriesi.at/themes/enfold/blog/']").prop("href", "https://google.com")
    })(jQuery);
    </script>
        <?php
    }
    add_action('wp_footer', 'custom_script');

    In the above code you will note the class .main-title, this is added so any menu links to the page will not be changed, then the next part of the code is the title link you want to change, then the last part is the link you want it to be.
    If you have any problems getting this to work then please link to the page and let us know where you want the link to point to.

    Best regards,
    Mike

    #1309701

    Hi Mike,
    thank you for your answer. Probably I wasn’t clear enough.
    I’d like to change the link (url) showing in each blog post header (ex.: https://www.sensity.pl/usmiechnieta-depresja-co-to/) not to point to the main site, but to https://www.sensity.pl/blog/

    https://snipboard.io/NQskje.jpg

    Thank you for your help!
    Chris

    #1309730

    Hi,
    Thank you for the feedback, try adding this code to the end of your functions.php file in Appearance > Editor instead:

    function custom_single_to_blog_script() { ?>
        <script>
    window.addEventListener('DOMContentLoaded', function() {
    (function($){
    $("#top.single-post .main-title > a[href^='https://www.sensity.pl/']").prop("href", "https://www.sensity.pl/blog/")
    })(jQuery);
    });
    </script>
        <?php
    }
    add_action('wp_footer', 'custom_single_to_blog_script');

    Best regards,
    Mike

    #1309781

    Works – thank you so much!
    Chris

    #1309788

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Change link of Blog – Latest news at the top of posts’ is closed to new replies.