Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   Insertion? (https://www.warriorforum.com/programming/374903-insertion.html)

ReikiGirl 3rd May 2011 04:37 PM

Insertion?
 
Not the dirty kind!

I wanna know on wordpress after I've created a page, I want a database table to show in the text area.

<?php
echo displayGirls();
?>

This is what I'd like on there - but apparently you can't insert php code into the text area?

Help? Pretty please?

Christian Little 3rd May 2011 05:31 PM

Re: Insertion?
 
Look for a plugin called execphp, it lets you execute PHP code in posts and pages.

ReikiGirl 3rd May 2011 07:59 PM

Re: Insertion?
 
Quote:

Originally Posted by Christian Little (Post 3820139)
Look for a plugin called execphp, it lets you execute PHP code in posts and pages.

So here's the thing though, normally in my other php page where I show the table...at the very top it calls the setup.php and the display.php but I'm not sure how to get it to insert that BEFORE the head tag doing it through wordpress. I know I could just change the header.php and duplicate it for just the one page I am setting up, but I don't know how to call the new header1.php for the one page?

Make sense?

Christian Little 3rd May 2011 09:09 PM

Re: Insertion?
 
Ahh...what you want is a page template. Basically wordpress lets you create subtemplates that you can set pages to use that are part of your theme but are only called from specific pages.

Here's a brief section that explains how to do it: Pages « WordPress Codex

But basically you create a new .php file (i.e. page2.php) in your themes directory and copy everythign that's inside of page.php into it. Then at the very top put some comment code in to name the template.

Then you go to whatever page you are doing this for, and select the template from the menu on the right when editing the page.

ReikiGirl 4th May 2011 07:57 AM

Re: Insertion?
 
Quote:

Originally Posted by Christian Little (Post 3821001)
Ahh...what you want is a page template. Basically wordpress lets you create subtemplates that you can set pages to use that are part of your theme but are only called from specific pages.

Here's a brief section that explains how to do it: Pages « WordPress Codex

But basically you create a new .php file (i.e. page2.php) in your themes directory and copy everythign that's inside of page.php into it. Then at the very top put some comment code in to name the template.

Then you go to whatever page you are doing this for, and select the template from the menu on the right when editing the page.

Makes complete sense - gonna try it today.


All times are GMT -6. The time now is 05:08 PM.