Support » Fixing WordPress » php echo inside $output

  • I’m trying to get a specific page content from a page and i need to insert this php code:

    <?php echo getPageContent(8); ?>

    i tried this:

    $output .= <<<HTML
    
    			</div>
    		</div>
    <div id="hometabs">
    echo getPageContent(8);
    	</div>
    <div class="clear"></div>
    	</div>
    
    	<div class="bottom_shadow"></div>
    
    </div>
    HTML;

    but it doesn’t work.. i even tried:

    getPageContent(8);
    echo getPageContent(8)

    still it didn’t

    note: i already have code for the getPageContent i’m just not sure why when viewing on my browser, this code: echo getPageContent(8) shows up instead of executing it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • esmi

    (@esmi)

    Forum Moderator

    Try using:

    <?php echo getPageContent(8);?>

    thanks but that didn’t work too. any other option?

    Michael

    (@alchymyth)

    Forum Moderator

    if getPageContent(8) returns a string of some sort, try string concatenation;

    example:

    ...
    <div id="hometabs">
    HTML;
    $output .= getPageContent(8);
    $output .= <<<HTML
    	</div>
    ...

    thanks but that didn’t work too.. what could be wrong.?

    Michael

    (@alchymyth)

    Forum Moderator

    can you post some code to put the snippet into context?

    possibly the code of the whole template?

    (please use the pastebin.com … )

    I assume that <?php echo getPageContent(8);?> does output the right content?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘php echo inside $output’ is closed to new replies.