Community Forums › Forums › Archived Forums › General Discussion › Putting php code on a page
Tagged: php
- This topic has 13 replies, 2 voices, and was last updated 11 years, 10 months ago by
Brad Dalton.
-
AuthorPosts
-
June 14, 2013 at 4:38 am #45829
nicole2013
MemberI 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!
June 14, 2013 at 4:48 am #45834Brad Dalton
ParticipantCould 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.
June 14, 2013 at 5:36 am #45843nicole2013
MemberThis 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.
June 14, 2013 at 5:49 am #45849Brad Dalton
ParticipantCould 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?
June 14, 2013 at 7:48 am #45880nicole2013
Memberhttp://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).
June 14, 2013 at 8:20 am #45892Brad Dalton
ParticipantSorry 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?
June 14, 2013 at 8:50 am #45903nicole2013
MemberSorry - 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
June 14, 2013 at 9:18 am #45912Brad Dalton
ParticipantI think you simply need to copy and paste any text and upload and insert images manually using the WordPress editor.
June 14, 2013 at 10:27 pm #46018nicole2013
MemberI 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?
June 15, 2013 at 4:06 am #46033Brad Dalton
ParticipantJune 15, 2013 at 4:34 am #46037nicole2013
MemberIt 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)
June 15, 2013 at 5:33 am #46045Brad Dalton
ParticipantYou'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?
June 15, 2013 at 10:43 pm #46220nicole2013
MemberI 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.
June 16, 2013 at 4:11 am #46228Brad Dalton
ParticipantI'd try the Plugins forum at the WordPress.org forums for this as there's many plugin Developers working there.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.