including .php on a wordpress page.

by taaron
9 replies
Hi guys.

I'm using a wordpress site, but I have my images hosted elsewhere on the domain as subdomains powered by Single File PHP Gallery. I tried to create a new page, and use the include php code to load up the gallery on the Wordpress page, but it seems like it won't load.

Any other suggestions I can do to include these galleries on their own Wordpress pages?

Thanks!
#including #page #php #wordpress
  • Profile picture of the author David V
    You shouldn't be trying to put a php include in a WP page, at least not through the admin area page editor.

    Use the php include on a custom page template in the theme folder.

    If you need to create the template, just copy, paste, rename a present one then modify it with your php code. Don't forget to rename the template, both filename and inside the code at the top where is says Template Name. Now you can just select that page template when creating a page.

    Edit: Wouldn't it be easier to just use a WordPress gallery and host the images on the subdomain rather then trying to include a php gallery from elsewhere?
    {{ DiscussionBoard.errors[8069276].message }}
  • Profile picture of the author taaron
    Oh, that's neat. I didn't know I could do that with the template.

    As for the hosting within Wordpress, not sure. I've tried a couple of gallery plug-ins for Wordpress and found keeping them organized to be quite a hassle compared to SinglePage.
    {{ DiscussionBoard.errors[8072458].message }}
  • Profile picture of the author SmallBizWebsites
    You could use an iFrame, but that brings with it some of its own problems.
    {{ DiscussionBoard.errors[8072661].message }}
  • Profile picture of the author lordspace
    WordPress has many gallery plugins maybe you can try some and move your images within WordPress.

    If I were to do it I'd create a shortcode that will get replaced with HTML code that loads the images from your subdomains.
    Signature

    Are you using WordPress? Have you tried qSandbox yet?

    {{ DiscussionBoard.errors[8076654].message }}
  • Profile picture of the author FirstSocialApps
    There are WP plugins out there that let you do this Im sure. If you cant find one you could always create your own. It would be a small job.
    {{ DiscussionBoard.errors[8076770].message }}
  • Profile picture of the author taaron
    Okidoke.

    So I decided to install a plug-in gallery and remembered why I wasn't fond of plugin galleries in the first place.

    NextGen only allows a Album, then a Gallery, and that's as deep as you can go.

    Is there an option or plug in where I can create an album, put a gallery in the album, then add sub galleries?
    {{ DiscussionBoard.errors[8108599].message }}
  • {{ DiscussionBoard.errors[8113603].message }}
  • Profile picture of the author annaharris
    You cannot use PHP include in a WP page through the admin area, But you can use WP plug-in to run PHP code in your WP page.
    {{ DiscussionBoard.errors[8118454].message }}
    • Profile picture of the author Steve Fleming
      Originally Posted by annaharris View Post

      You cannot use PHP include in a WP page through the admin area, But you can use WP plug-in to run PHP code in your WP page.
      I've used a few of those plugins and they all have the same problem. When you move from text editor to visual editor it screws up the code. Trying to remember to change to text editor before you access the page is a pain in the butt.

      A much better solution is the one offered by David and use a custom page template.

      Steve
      {{ DiscussionBoard.errors[8118467].message }}

Trending Topics