PHP include for Wordpress

Discussion in 'PHP' started by b4db0y, Mar 6, 2010.

  1. #1
    I have a blog. It has 43 page~47 pages. I want to add a php file on xxx.com/page/2/

    How can i do that? Is there any way?
     
    b4db0y, Mar 6, 2010 IP
  2. SpamHat

    SpamHat Peon

    Messages:
    27
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can do it properly, or use a quick hack to wedge it in there.

    Drop this where you want it to appear in your template and it will only show when 'page/2' is in the url.

     <?php if( strstr( $_SERVER[REQUEST_URI], 'page/2/' ) ) include '/path/top/your/file.php'; ?> 
    PHP:
     
    SpamHat, Mar 6, 2010 IP
    b4db0y likes this.
  3. b4db0y

    b4db0y Notable Member

    Messages:
    3,523
    Likes Received:
    74
    Best Answers:
    0
    Trophy Points:
    205
    #3
    Thanks i got it correctly. rep added
     
    b4db0y, Mar 6, 2010 IP