Putting php code on a page

Community Forums Forums General Discussion Putting php code on a page

This topic is: not resolved

Tagged: 

This topic contains 13 replies, has 2 voices, and was last updated by  braddalton 1 year, 4 months ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #45829

    nicole2013
    Participant
    Post count: 29

    I have just moved from Thesis to Genesis. I am trying to show the contents of a php file on a page. In Thesis, I used to have a custom template and had the following code in my functions file:

    function after_post_ad() { ?>

    <?php   if (is_page(‘test’)) { // pixenate page tag     include (ABSPATH . ‘/pixenate/index.php’);   }   ?>

    I am trying to get this to work in Genesis.

    Where do I put this code in Genesis and is there anything else that I have to do to get it to work?

    This is what I have tried:

    1)  I copied that code as is in the functions file and it broke the site. I guess I should have changed the first line.

    2) I put it in as a hook without the first line but nothing happened.

    Any help would be much appreciated!

     

    #45834

    braddalton
    Participant
    Post count: 10337

    Could you please paste the entire code on Github Gists or Pastebin and link to it from here. Thanks

    Firstly, you don’t need php tags in functions file, only when using PHP in template files or the Simple Hooks plugin.


    #45843

    nicole2013
    Participant
    Post count: 29

    This is the contents of the custom template the was used.

    This is the code that was pasted in the functions file (in Thesis it is called the custom functions.php). The first line I guess relates to everything but the next 5 lines are repeated for each page used.

    #45849

    braddalton
    Participant
    Post count: 10337

    Could you link to your site please.

    I think the code is just demo code for creating a custom function but it is incomplete.

    What exactly do you want the code to do?


    #45880

    nicole2013
    Participant
    Post count: 29

    http://www.creativecertificates.com/good-behavior-award-certificate-with-photo/

    On the above page the content is inserted into the page using an iframe. I would like to insert it into the page without using an iframe.

    For example:

    http://www.creative-calendars.com/photo-calendar-2013/green/

    here is was inserted via custom template (using the Thesis theme).

     

    #45892

    braddalton
    Participant
    Post count: 10337

    Sorry but i don’t follow. What content are you referring to? The entire page or just part of it? How many pages of content are you talking about?

    What type of content is it? Text and images?


    #45903

    nicole2013
    Participant
    Post count: 29

    Sorry – it wasn’t clear.

    This is the page that I presently have inserted via an iframe but I would like to insert without using an iframe:

    http://www.creativecertificates.com/pixenate/themes/cardmaker/behavior.php

     

    #45912

    braddalton
    Participant
    Post count: 10337

    I think you simply need to copy and paste any text and upload and insert images manually using the WordPress editor.


    #46018

    nicole2013
    Participant
    Post count: 29

    I tried this but it didn’t work:

    http://www.creativecertificates.com/2207-2/

    I put the code from the <head> into the Custom Tracking/Conversion Code section and I added the code from the body to the actual post (using the text editor).

    Is that the correct way to do it since it is code and not really text? Have I missed something major?

     

    #46033

    braddalton
    Participant
    Post count: 10337

    What sort of code is it?

    What sort of content is it?


    #46037

    nicole2013
    Participant
    Post count: 29

    It is Php code. It edits a photo which is uploaded. It is a program called Pixenate. This is the code (but it also uses other content which it links to which might be the problem)

    http://pastebin.com/nzyG9Jad

    #46045

    braddalton
    Participant
    Post count: 10337

    You’d need a custom page template for that.

    I suggest you try and find a WordPress plugin which does the same thing.

    What is it that you want the code to do?


    #46220

    nicole2013
    Participant
    Post count: 29

    I would love to find a WordPress plugin which does the same thing but I have spent months looking and haven’t found one.  I don’t mind (in fact I would prefer) a premium plugin.

    Basically what I am looking to do is to upload an image and enable users to add text and a photo to the image. It is basically the same functions used when producing photo books. Sites like Shutterfly, Snapfish, etc. provide the background images and users upload photos which are added to the background. I’m sure that there are better programs out there but unfortunately I haven’t been able to find one.

    #46228

    braddalton
    Participant
    Post count: 10337

    I’d try the Plugins forum at the WordPress.org forums for this as there’s many plugin Developers working there.


Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.