• I’m trying to display a cool image slider only when on the homepage.

    I have this code so far, I realise it’s wrong but I can’t find the solution. How do I call echo get_royalslider(1) already within an echo?

    Thanks in advance for any help!

    <?php	if(is_page('Homepage')){
    echo '
    }
    
    				<div id="slider-wrap">
    
    		<div id="slider-inner-wrap">
    
    		<?php echo get_royalslider(1); ?>
    
    		</div>
    
    		</div>
    
    ';?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Try this. Don’t echo until you need to echo.

    <?php if (is_page('Homepage')): ?>
    <div id="slider-wrap">
      <div id="slider-inner-wrap">
        <?php echo get_royalslider(1); ?>
      </div>
    </div>
    <?php endif ?>
    Thread Starter dwjoll

    (@dwjoll)

    Thanks jevets!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP help for a noob. Function call within an echo’ is closed to new replies.