Redirection of Read more

  • Frym1

    #7022

    After hours of learning thought id resolved it, but not 🙁

    Quick explanation as follows:

    The 4 home pages on my static word press site currently point to the 4 individual services pages, when I click the Read more button.

    What I want to do i hide the pages from the navigation bar (done), create a page called services and then have the 4 homepages click to the overall page ‘services’.

    Thanks however it confusing the life out of me.

    Any step by step instructions would be well appreciated. PLEASE.

    Anonymous

    #36550

    Deleted duplicate thread in general talk section.

    You can hide read more buttons pointing to the page with CSS and then create a custom read more button with a link to external site/page.

    Example,

    <a class="block-button" href="http://domain.tld/page">Read more</a>

    What’s the URL of your site?

    Frym1

    #36551

    Thanks Prasanna,

    The URL is http://www.eqoilfield.com

    My design knowledge is improving however this time I am beaten 🙁 If you could give me a quick breakdown of how to do this I would be so appreciative. Really struggling.

    Thanks

    Anonymous

    #36552

    Where do you want the individual homepage panes to be linked?

    Anonymous

    #36553

    You can also use graphene_bottom_content action hook and replicate the homepage panes, of course with custom links.

    Frym1

    #36554

    Firstly thanks for your help mate, appreciated. I would like the homepanes to bypass there original pages (hidden) and be directed to Services page.

    Mark

    Anonymous

    #36555

    Do you want all the 4 Read more buttons in homepage panes to link to this page? – http://www.eqoilfield.com/?page_id=125

    You can change the DOM to replace Read more link once the page is loaded. If it sounds okay, add this to custom <head> tags in Graphene Options –> Advanced.

    <script type="text/javascript">
    jQuery(document).ready(function($){
    $('.homepage_panes').ready(function(){
    $('.homepage_panes .post-comments').html('<a class="block-button" href="http://www.eqoilfield.com/?page_id=125">Read more</a>');
    });
    });
    </script>

    Or, add this to child-theme’s functions.php

    function homepage_panes_change_readmore_link() {
    if(is_front_page() {
    ?>
    <script type="text/javascript">
    jQuery(document).ready(function($){
    $('.homepage_panes').ready(function(){
    $('.homepage_panes .post-comments').html('<a class="block-button" href="http://www.eqoilfield.com/?page_id=125">Read more</a>');
    });
    });
    </script>
    <?php
    }
    }
    add_action('wp_head','homepage_panes_change_readmore_link');

    Frym1

    #36556

    Pransanna

    Firstly thanks for taking the time out to help me. Really appreciated.

    I have put the above code into the child fuctions php file ensuring it has been placed between.

    <?php ?>

    Unfortunatly it returned a file server error. I went into my root server and removed this code in order that the website works. Am i doing something wrong in placing the code in between

    <?php ?>

    Thanks

    Mark

    Anonymous

    #36557

    Closing php tag is not necessary. You should be using the code like this,

    <?php
    function homepage_panes_change_readmore_link() {
    if(is_front_page() {
    ?>
    <script type="text/javascript">
    jQuery(document).ready(function($){
    $('.homepage_panes').ready(function(){
    $('.homepage_panes .post-comments').html('<a class="block-button" href="http://www.eqoilfield.com/?page_id=125">Read more</a>');
    });
    });
    </script>
    <?php
    }
    }
    add_action('wp_head','homepage_panes_change_readmore_link');

    Can you post the content of your chuld-theme’s functions.php? Use pastebin.com to share code.

    Frym1

    #36558

    Hi mate.

    I have no code in child php file. Only above code copied and pasted.

    However problem resolved by custom <head> tags in Graphene Options –> Advanced.

    Mark

Viewing 10 posts - 1 through 10 (of 10 total)

  • You must be logged in to reply to this topic.
Do NOT follow this link or you will be banned from the site!