Jump to content
Sign in to follow this  
sgendry

what is the best way to create a new page with custom php code?

Recommended Posts

sgendry

I want to embed a separate php application inside of a page so that it looks part of my website. It works well on a different wordpress site that I have and all we did there was add our code in the relevant place of a custom page.php (we simply renamed the template). Pagelines, however, appears to use something different. All there is inside of page. php is "setup_pagelines_template();" so I don't know where to paste my code. Any suggestion?

Share this post


Link to post
Share on other sites
kastelic
You would place your code inside a custom "section" which then could be placed in a custom template or an existing template. Check out the tutorial videos on how to do this: http://www.pagelines.com/wiki/index.php?title=PageLines_Essential_Training

Share this post


Link to post
Share on other sites
sgendry
Your help is much appreciated. Thank you.

Share this post


Link to post
Share on other sites
sgendry
Apologies, but I cannot get my head around this. I have watched the videos you suggested (which have been moved since then and are now at http://www.pagelines.com/wiki/Video_Tutorials), but to no avail. What exactly do you mean with a "custom section"? Let's say for example that I want to create a page to put my website sitemap. I am using the Dagon Design Sitemap Generator plugin (http://www.dagondesign.com/articles/sitemap-generator-plugin-for-wordpress/) Technically all I would have to do is paste into the template of my choice. This is where I get stuck. This was easy in classic wordpress themes. Pagelines is a sensitive race horse that requires a more intimate knowledge of how its functioning. All I want is the header, footer, and a 1 column content in-between with my custom code. How do I do that? Where do I paste that code? I could create a hook (I have a very primitive understanding of how these work), but then how would I have it display only on the page where I want it displayed?

Share this post


Link to post
Share on other sites
sgendry
Fixed. Here is the hook I pasted in functions.php inside the pagelines-customize plugin folder: add_action('pagelines_loop_after_post_content', 'sitemap'); function sitemap() { if ( ! is_page( 590 ) ) return; ?>

Share this post


Link to post
Share on other sites
Simon
Better code: http://paste.pagelines.com/498 Always namespace your functions, chances are there are 100's if not 1000's of sitemap plugins with functions called sitemap(). Also added a check to see if your sitemap plugin is enabled.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×