• Resolved gerardog2000

    (@gerardog2000)


    Hello, I know that this has been posted many times before, but I am still having trouble with my specific theme. I would like to display any type of advertisement in between posts (every 5th post, i.e. at 5th, at 10th, at 15th, etc.)on the Beauty Style theme.

    https://newwpthemes.com/demo/BeautyStyle/

    That is where I got the theme from and I emailed the author of the theme but he did not respond. My website is incomplete but it is https://www.techcorner.com.

    I researched www.remarpro.com and found instructions on how to do it, but the code that they had me find is not in the index.php.
    They had me find:
    <?php endforeach; else: ?>
    and then insert
    <?php if ($postnum == $showads) { ?> <<ADD ADVERTISING HERE>> <?php } $postnum++; ?>
    before that last line of code. Like I said, I could not find that code in the index.php file. I am not very good with code so if anybody would be nice enough to help me, I will be so very grateful.

    Note: I would be open to any plugins that do this efficiently. I tried Advertising Manager as somebody suggested but I don’t see how I would be able to accomplish the above task with this plugin.

    On a side not, How would I remove the stars on the widgets that denote recent comments and posts, etc. I just want them to be generic like a bullet or something in that order.

    Thank you for any help that I receive.

Viewing 4 replies - 1 through 4 (of 4 total)
  • if your theme runs the ‘normal’ loop, the line to look for would be (in index.php):
    <?php endwhile; ?>

    add something like this before the line:

    <?php $postnum++; if($postnum%5 == 0) { ?>
    YOUR AD CODE HERE
    <?php } ?>

    if you can’t identify the right spot, you could paste the code from index.php into a https://wordpress.pastebin.com/ and post the link to it here; someone might then be able to point to the right line.

    Thread Starter gerardog2000

    (@gerardog2000)

    That worked perfectly. I have another request. Do you know how to remove the stars that this theme is using as bullets and just replace them with something generic like a dot or arrow? Thanks again, I really appreciate your help.

    if you don’t mind that the ‘bullets’ are done by background images, you could simple edit the existing one (photoshop or so) :
    images/bullet.gif

    Thread Starter gerardog2000

    (@gerardog2000)

    That also works great, thanks for the help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘inserting ads between every 5th post.’ is closed to new replies.