WordPress.org

Ready to get started?Download WordPress

Forums

how to display urls??? (6 posts)

  1. softsoft
    Member
    Posted 5 years ago #

    how to display urls after my site url http://www.mysite.com

    say post link is http://www.mysite.com/i-love-wordpress.html

    i want to display i-love-wordpress.html only.

    i used <?php echo $_SERVER["REQUEST_URI"]?> but it is not working.

    can some one help me please.

  2. softsoft
    Member
    Posted 5 years ago #

    Any Help Please???

  3. Jeremy Clark
    Moderator
    Posted 5 years ago #

    What are you talking about? Creating a link.
    <a href="http://www.mysite.com/i-love-wordpress.html">i-love-wordpress.html</a> Will show up like this. i-love-wordpress.html

  4. softsoft
    Member
    Posted 5 years ago #

    <?php echo $_SERVER["REQUEST_URI"] ?>

    this code should display posts ,categories and tags links without http://www.mysite.com to be like:

    /my-post.html
    /category
    /tag

    but it is not working.

  5. taffeljohan
    Member
    Posted 5 years ago #

    <?php echo parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); ?>

  6. softsoft
    Member
    Posted 5 years ago #

    Thanks taffeljohan,
    it is working fine.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.