WordPress.org

Ready to get started?Download WordPress

Forums

Detect if it's a singe article outside wordpress (1 post)

  1. chris-babww
    Member
    Posted 1 year ago #

    Hello,
    I am building a mobile version of the main website of my company.
    Basically, I have created only an index.php page and include wp-load.php

    I have written some custom function, so I can have the slug of each page/article (passing through a get variable).

    Anyway, I would like to create a custom page for single articles. I'm trying the is_single function, but it doesn't work.

    Here is the code:

    <?php $page = $_GET['p']; ?>
    
    <?php // Special content for Single Article page ?>
    <?php if( is_single( $page ) ) { ?>
    <p>custom text here</p>
    <?php } ?>

    Any idea?

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic