Support » Fixing WordPress » Detect if it's a singe article outside wordpress

  • chris-babww


    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?


  • The topic ‘Detect if it's a singe article outside wordpress’ is closed to new replies.