Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author benz1

    (@benz1)

    You should use the PHP Code type, but be aware that the code will be interpreted by the PHP parser so should be written like this:

    $themepath = "https://localhost/shriram/wp-content/themes/twentyeleven-child/images";
    
    echo '<div class="bottomSlider"><img src="'.$themepath.'/shriram-home-finel_39.jpg" /></div>';

    or similar.

    Also, make sure you use the HTML tab of the editor when adding the code as the Visual tab will transform all tags into html safe entities which will raise an parser error if placed in a php content block.

    Thread Starter vineela.s

    (@vineelas)

    I have tried your solution

    $themepath = bloginfo(‘stylesheet_directory’);
    echo ‘<div class=”bottomSlider”><img src=”‘.$themepath.’/images/sliderImg.jpg” /></div>’;

    and the ouput is
    https://localhost/shriram/wp-content/themes/twentyeleven-child<div class=”bottomSlider”><img src=”/images/sliderImg.jpg”></div>

    themepath is printing above the div not inside image tag….

    help me on this .

    Plugin Author benz1

    (@benz1)

    You need to use the function ‘get_bloginfo’ instead of ‘bloginfo’ which directly echoes the result.

    I’m sorry but this is nothing to do with the plugin so I really can’t healp you any further with this.

    Thread Starter vineela.s

    (@vineelas)

    hi it is working like charm thank u so much for ur help ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘content block with php variables included in html’ is closed to new replies.