• I’m trying to override the_content with HTML from my functions.php file. I want to:

    1. Check if this is Page X
    2. If it is the correct page, replace the_content with my own code

    Is there a way to do this? Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • It would be easier to add the coding to the page template file.

    <?php if( !is_page('X') ) :?>
    [ custom content ]
    <?php else the_content();
    <?php endif;?>

    But if this is for a plugin, a template file update is not option correct?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How do I override the_content for a specific page?’ is closed to new replies.