[Support request] Insert PHP code into footer.php

Home Forums Support [Support request] Insert PHP code into footer.php

Home Forums Support Insert PHP code into footer.php

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #344634
    Robert Cioffi

    I’m trying to isert this code into my footer.php

    if ( ($eventlisturl = get_post_meta( $post->ID, 'eventlisturl', true ) )) {
    $eventlistoutput = file_get_contents( $eventlisturl );
    
    $search = array( "$location", "$url" );
    $replace = array( get_the_title(), "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
    $eventlistoutput = str_replace( $search, $replace, $eventlistoutput );
    echo $eventlistoutput;
    }

    I’ve also tried using the footer hook, but in either case the code just prints out on the bottom of my site. Any thoughts? Thanks.

    #344677
    David
    Staff
    Customer Support

    PHP needs to be entered with opening and closing Tags
    <?PHP code ?>

    #344680
    Robert Cioffi

    I thought so. Thanks.

    #344695
    David
    Staff
    Customer Support

    Your welcome

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.