• Resolved ANGE1K

    (@erzr)


    Hello Igor,

    First of all, let me tell you that you have developed an amazing plugin. However, I got some issues around the following code:

    		<?php $author = get_post_field('post_author', get_the_ID());
    		if ($author == '3') { 
    		echo adinserter(1); 
    		} elseif ($author == '3') { 
    		echo adinserter(2); 
    		} elseif ($author == '3') {
    		echo adinserter(3);
    		} else {}
    		?>

    However, It seems like the code is not working for me… I tried to put this file in the functions.php and also single.php and the adds are still showing up doesn’t matter who author wrote the article.

    It seems that I cannot find a way to actually place the php function. I am begging you, please, if there’s a way around this let me know as fast as you can.

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter ANGE1K

    (@erzr)

    Igor, I finally managed to do it. If you allow me I can post the code on this forum.

    Best Regards,
    Angel.

    Thread Starter ANGE1K

    (@erzr)

    Oh, another fact is that when I select only on selected pages and use the shortcode like this

    if ($author_id==”1″) {
    echo do_shortcode(‘[adinserter block=”1″]’);
    echo do_shortcode(‘[adinserter name=”Block 2″]’);

    The settings on the add do not apply, which means they are one after another and doesn’t go after any paragrah…

    Plugin Author Spacetime

    (@spacetime)

    I’m not sure if I understand your problem.

    If you use Ad Inserter shortcode then the code for the block will appear exactly where the shortcode is present – or echoed. This has nothing to do with paragraphs. Paragraph (and many other) block settings apply to automatic insertion, but you are using manual insertion – shortcodes.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Ads per Author With PHP Function’ is closed to new replies.