Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Header configuration & styling »

[SOLVED] Stand Alone Page with PHP Code?


  #1  
Old Sep 23, 2011, 02:55 PM
GRF
 
76 posts · Mar 2011
I need to add a page that has all the elements (i.e. header, widgets, footer, etc.) with custom PHP added to the center column (where post article content code goes)

I tried this code below but complains of missing functions. I'm using v3.6.4

Here is my source in my .PHP file.

<?php /* get all options: */
# error_reporting(-1);

list($bfa_ata, $cols, $left_col, $left_col2, $right_col, $right_col2, $bfa_ata['h_blogtitle'], $bfa_ata['h_posttitle']) = bfa_get_options();

get_header();

extract($bfa_ata);

<!-- MY PHP CODE -->

?>

<?php get_footer(); ?>
  #2  
Old Sep 23, 2011, 03:13 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
what functions does it say it is missing?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Sep 23, 2011, 06:00 PM
GRF
 
76 posts · Mar 2011
Fatal error: Call to undefined function bfa_get_options() in /home/tsfl/public_html/healthyweightlosssystem.net/linkpartners.php on line 4
  #4  
Old Sep 23, 2011, 06:26 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
are you using this as a template or a pagexx.php file?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Sep 23, 2011, 06:35 PM
GRF
 
76 posts · Mar 2011
No template, just pagexx.php file.

I'm putting some link partner .php code in it and can't uses the ExecPHP plug-in because it conflicts with another plun-in I use.
  #6  
Old Sep 23, 2011, 07:30 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
I'd have to see the exact code to be of any help
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #7  
Old Sep 23, 2011, 09:31 PM
GRF
 
76 posts · Mar 2011
?php /* get all options: */
# error_reporting(-1);

list($bfa_ata, $cols, $left_col, $left_col2, $right_col, $right_col2, $bfa_ata['h_blogtitle'], $bfa_ata['h_posttitle']) = bfa_get_options();

get_header();

extract($bfa_ata);

echo "MY PHP CODE"

?>

<?php get_footer(); ?>
  #8  
Old Sep 24, 2011, 05:26 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
when I use that code and stick it in a file called 'page-nn.pgp' (where nn= the page ID number) it works fine - I get the message 'MY PHP CODE"
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #9  
Old Sep 24, 2011, 07:08 AM
GRF
 
76 posts · Mar 2011
Great. You meant 'page-nn.php' not 'page-nn.pgp', correct?

But how did you get the page ID? Did you have to create a page in Wordpress to get an ID? If so, what did you call the page name in WordPress?
  #10  
Old Sep 24, 2011, 08:36 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
(arugh...I love/hate auto correction)

I create a page and give a it a title then when you go to edit it look at the URL. You'll see at the end a post=nn the number nn is the page id.

How were you doing it?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #11  
Old Sep 24, 2011, 11:05 AM
GRF
 
76 posts · Mar 2011
OK. Did that to. Created a Blog Page, gave it a title, found the post id (post=422).

Did you add the PHP code in the Wordpress editor (clicking the HTML Tab)?

What did you us in the web browser to display the page where all the blog template elements displayed along with the PHP text message?
  #12  
Old Sep 24, 2011, 02:03 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
if you want a file to run when a page shows up, you create your file page-422.php with the code you want. you put it in the theme folder (in this case the atahualpa folder) and that is the code that will be run when you go to that page.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Sep 25, 2011 at 03:09 AM.
  #13  
Old Sep 24, 2011, 10:24 PM
GRF
 
76 posts · Mar 2011
Fantastic. It's working now. You literally meant page-#.php. I was using the name of the page I created in wordpress, lile linkpartners-422.php

As soon I get money rolling in from this blog, I'm donating funds to your PayPal account. This theme is so versatile and useful even though a little complicated to customize in certain ways.
  #14  
Old Sep 25, 2011, 04:21 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
page naming when you want to use it like this, is controlled by WordPress
Quote:
Templates by page-ID or page-Slug
You can use different archives "page", with ID or slug in your name. Only Available with Version 2.9.

examples:

page-{id}.php
page-{slug}.php
from http://codex.wordpress.org/Pages
so you just named the php file wrong, you could have used page-422.php or page-linkpartners.php (that is if 'link partners' is the slug of the page)
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] copy/pasting jquery code in page apparently generates unwanted code tags (p, mafgirl Center area post/pages 2 Jan 19, 2012 09:10 AM
PHP code in page kicker lars.johan@hotmail.com eCommerce & Atahualpa 5 Sep 22, 2011 05:34 PM
Adding code for ads or other sites (newbie when it comes to code issues!) gardentravelbuzz Plugins & Atahualpa 7 Feb 7, 2011 04:43 AM
How do I code an anchor link from one page to another page? kippiper Center area post/pages 1 Sep 13, 2010 02:57 PM
[SOLVED] Stand alone php page on Atahualpa theme catherinehbbh Forum How-To 2 Apr 7, 2010 07:34 PM


All times are GMT -6. The time now is 01:41 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.