Results 1 to 3 of 3
  1. #1
    TravG's Avatar
    TravG is offline Private Member
    Join Date
    September 2008
    Posts
    2,068
    Thanks
    34
    Thanked 179 Times in 131 Posts

    Default Help with Wordpress and PHP Includes

    I am finally getting better with Wordpress but wondering if anyone can answer this question.

    I am using a php include for a short review of poker sites that I use on many pages. The code I am using is this:
    <?php include(ABSPATH.'/wp-includes/phps/pokerhost.php'); ?> (you can see it live at www.usalegalpoker.net)

    It works but I have to write it in the "HTML" mode for the page or post which is fine. However if I switch back to the "Visual" mode and publish the page or update the page the info dissapears and when I look at in "HTML" mode again the above code turns to "&nspb;".

    Is there a way around this? I have to think there is but I have Googled stuff to try to fiqure it out with no luck.

    Any help much apprieciated.
    Live Casino USA - the best USA live online casinos. Play USA online slots and other casino games like USA online blackjack. Play at USA online casinos and find the best USA online casino and USA legal slots. https://mobileslotslisting.com
    Want to play USA online poker find the poker sites at 4DeucesPoker.com

  2. #2
    cocota is offline Private Member
    Join Date
    September 2002
    Posts
    46
    Thanks
    0
    Thanked 17 Times in 4 Posts

    Default

    hello,

    You can't put directly a php code on the page or article editor (or you must use a plugin), but the best way if you want your include in a page you must create a page template before, and put directly your include code on your new page template......

    Page template and conditionnal tag are your solution

    For an article you must use conditionnal tag on your single.php file......

    So, where do you want use this include : on page or for article ??
    USA Online Casino - Online Casinos that accept USA and Canadian Players.
    Jouercasinoenligne.ch - Casinos en ligne légaux en Suisse.

  3. #3
    TravG's Avatar
    TravG is offline Private Member
    Join Date
    September 2008
    Posts
    2,068
    Thanks
    34
    Thanked 179 Times in 131 Posts

    Default

    Quote Originally Posted by cocota View Post
    hello,

    You can't put directly a php code on the page or article editor (or you must use a plugin)
    Thats not correct. I figured out a way to do it. I created a folder in the wp-includes folder and created the php scripts in that folder and updoaded them. Then I just use an include on the page I want the php to appear. It works but like I say it dissapears if I switch to the "Visual" mode of the page in WordPress.

    I want to use these in pages. Maybe I am going about it the wrong way but what I am trying to do is save time updating pages. For example if I have a page listing USA poker sites, a page listing bonuses, a page for Mac poker sites, I use the same php in every page for multiple poker sites. I will have a php for Poker Host, Intertops, 888 etc etc that give a short review of the site and only put that php in the pages that are relevent. The php may appear on 20 pages. Then if something changes I only have to update 1 file (the php file) but it changes on all the pages I have it.

    Am I over thinking this? Like I say it works and is better than the oold way of copying and pasting all the info to many different pages.
    Live Casino USA - the best USA live online casinos. Play USA online slots and other casino games like USA online blackjack. Play at USA online casinos and find the best USA online casino and USA legal slots. https://mobileslotslisting.com
    Want to play USA online poker find the poker sites at 4DeucesPoker.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •