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

    Hello,

    I need to link the title of each column in the homepage to an specific page. The landing page will not have the text of the original column and it will be a completely new page.

    I have created the columns as a post but I can change them to pages if it is needed. Could you please help me? Thank you for your great work!

    #30807

    Hi!

    I’m not sure I fully understand what you mean. Can you post a link to your site and elaborate on which text should not be on the “landing page”.

    Best regards,

    James

    #30808

    Hello James,

    my page is http://www.alimmenta.com/ . For example, the column “Consigue el maximo en tu deporte” should link to the page http://www.alimmenta.com/dietista-deportivo/ (this page now is without text but exists).

    #30809

    Ok, by the looks of it what you’re trying to do is use a custom page link, rather than link to the post URL.

    There are a couple of changes you need to make for this to work:

    1.) Open up /framework/classes/kclass_display_box.php and find this code:

    echo '<a href="'.get_permalink().'" class="more-link">Read more</a>';

    Replace it with this code:

    $new_link = get_post_meta($post->ID, "new_link", true);

    if($new_link) {
    echo '<a href="'.$new_link.'" class="more-link">Read more</a>';
    } else {
    echo '<a href="'.get_permalink().'" class="more-link">Read more</a>';
    }

    This will dynamically select the $new_link if it exists otherwise default to the permalink.

    2.) You need to go to WP admin and edit your post “Consigue el maximo en tu deporte” and create a custom field called “new_link”. Enter the URL here that you want to point the Read More to, in your case http://www.alimmenta.com/dietista-deportivo/

    This is something that has come up already and I will talk with Kriesi about including this in the next framework update.

    #30810

    It was not exactlly what i wanted but it helped me to solve my issue. What I wanted is that the the link of the title of the post went to another page.

    First, I added this line to the /framework/classes/kclass_display_box.php

    $new_link = get_post_meta($post->ID, “new_link”, true);

    and then replace the code

    echo’<h3>‘.get_the_title().’</h3>’.”n”;

    with this other

    if($new_link) {

    echo’<h3>‘.get_the_title().’</h3>’.”n”;

    } else {

    echo’<h3>‘.get_the_title().’</h3>’.”n”;

    }

    Thank you for your great support!

    #30811

    Hi!

    No problem, glad you managed to adapt what I posted to fit your needs.

    If you have any other questions let me know.

    Best regards,

    James

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

The topic ‘Change links in homepage columns’ is closed to new replies.