• Resolved bboy131

    (@bboy131)


    I have been trying to figure this out forever now. I have found a lot of sites that say “Hey just insert this code into your index.php file” but the problem is Mystique does not have the code they say is suppose to be there.

    I want to insert an Adsense block after the first post on homepage/pages.

    The code they gave me was

    <?php if(!$show_ads){ ?>

    [advertisement goes here]

    <?php $show_ads = 1; } ?>

    But that doesn’t work. Any ideas?

Viewing 3 replies - 16 through 18 (of 18 total)
  • yes, upgrading from 1.7 to 2.x can go wrong since most of the code has been changed in 2.0

    try this:
    – disable any cache plugins
    – delete the old theme, the upload the new one
    – refresh the homepage, enable back the cache plugins

    if this still doesn’t fix the problems, press the “reset settings” button from the theme settings. make sure you save any code you have there before you do that

    Thread Starter bboy131

    (@bboy131)

    That worked. Plugin was causing problems. I will upgrade and use the previous code you gave me above. Thanks for the help!

    Hello DigitalNature this question goes to you.

    I have a blog (patataloca.net) with the theme mystique. I used the following code to put an adsense block below the first post.

    <?php
    function my_ads(){
      global $ads_already_displayed;
      if(is_home())
       if(!$ads_already_displayed){
        $ads_already_displayed = 1;
        echo do_shortcode('[ad code=1]');
       }
    } 
    
    add_action('mystique_after_post', 'my_ads');
    ?>

    So far, so perfect, but I also want to put a adsense block on post number 8 for example. What would you change or add to show me the adsense below the first post (as I had) and also in the eighth?

    Sorry if I’m not well understood, but I am Spanish and my English is not perfect.

    Thank you very much and hope you can help.

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘How to add advertisement after first post?’ is closed to new replies.