1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Help needed in a little code change

Discussion in 'WordPress' started by Divvy, May 29, 2015.

  1. #1
    Hello guys,

    My site: http://www.sitesporno.xxx [ADULT CONTENT]

    Maybe someone can help me...
    I use a wordpress theme where is possible to add an affiliate link in each post. This link appears in posts page (single.php file)
    Screenshot: http://i.imgur.com/yd77eax.png
    single.php code: http://paste2.org/2jdds53V

    Now I want to add the affiliate link in homepage too... changing includes/entry.php

    But when I change from:
    <h2 class="title"><?php the_title(); ?></a></h2>
    PHP:
    To:
    <h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <a target="_blank" href="<?php echo $et_affiliate_link; ?>" rel="nofollow"><img border="0" src="http://www.sitesporno.xxx/imagens/visit.png" /></a></h2>
    PHP:
    And add this variables:
    $et_affiliate_text = isset( $et_inreview_settings['et_affiliate_text'] ) && !empty($et_inreview_settings['et_affiliate_text']) ? $et_inreview_settings['et_affiliate_text'] : '';
    $et_affiliate_link = isset( $et_inreview_settings['et_affiliate_link'] ) && !empty($et_inreview_settings['et_affiliate_link']) ? $et_inreview_settings['et_affiliate_link'] : '';
    PHP:
    Doesn't work... the affiliate link appears only as "http://www.mydomain.com".
    What am I doing wrong?

    Screenshot: http://i.imgur.com/xFyJROc.png
    entry.php code: http://paste2.org/YUa2dwvg


    Can someone help me please? :)

    Thanks!
     
    Divvy, May 29, 2015 IP
  2. Karen May Jones

    Karen May Jones Prominent Member

    Messages:
    3,469
    Likes Received:
    290
    Best Answers:
    1
    Trophy Points:
    380
    #2
    Have you thought about talking to the person who created the theme. People who make themes are often happy to help make some adjustments - or show you how. That's been my experience with most them makers. I love hacking away at wordpress, but now I find that its best to make a little plugin or whatever they call it - a mini theme (child theme?) so that your changes are not over written when the theme gets updated. Good luck with that.
     
    Karen May Jones, Jun 3, 2015 IP
  3. Qualdorei

    Qualdorei Greenhorn

    Messages:
    45
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    23
    #3
    try to do the same in other files, not just in single.php
     
    Qualdorei, Jun 4, 2015 IP