Jump to content
Sign in to follow this  
peterb

Inserting YARPP code into php for Pagelines Framework

Recommended Posts

peterb

Guides tell me to insert custom code into single.php. That file is almost empty in Frameworks. Totally different from EcoPro. Where do I insert the code for YARPP?

Share this post


Link to post
Share on other sites
catrina
You'll need to paste that code into a different file, but first, you'll need the Pagelines Customize plugin available from the store (http://www.pagelines.com/store). For instructions on how to install a plugin from the store, please see here: http://www.pagelines.com/wiki/index.php?title=How_to_Use_the_PageLines_Store. Once the plugin is activated, the code can be implemented.

Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
peterb
Alright. I've installed the Pagelines Customize plugin from the Pagelines Store in the backend. Where do I go from there?

Share this post


Link to post
Share on other sites
Danny
Hi Peter, Pagelines Customize Plug-in (This contains style.css and functions.php, just like a child theme.) Download and Activate Instructions: To get the Pagelines Customize Plugin, login to your Wordpress Admin Dashboard --> PageLines --> Store --> Plug-ins --> Add Plug-ins --> Top Free --> Pagelines Customize Plugin --> Install--> Activate. Once activated you can find the style.css and functions.php files in: wp-content/plugins/pagelines-customize/

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
peterb
I took a quick look at functions.php... Totally different from when I edited the single.php file in EcoPro. I have no idea what to input besides the YARPP code.

Share this post


Link to post
Share on other sites
kastelic
You have to insert the code using a hook. Here are the list of hooks: http://api.pagelines.com/hooks For example: [code]add_action('pagelines_loop_after_post_content','myCode'); function myCode(){ //insert your php code here and it will display on your site //after the post content. Change the hook to change the location. }[/code]

Share this post


Link to post
Share on other sites
peterb
Thanks for that kastelic, but unfortunately it didn't work. I'm probably inputting it wrong. When I put in that code, my site broke, with a reference to the code that I put in: "Parse error: syntax error, unexpected '<' in /home/myserverino/einstein.is/wp-content/plugins/pagelines-customize/functions.php on line 50" This is what I put in: [code]add_action('pagelines_loop_after_post_content','myCode'); function myCode(){ }[/code]

Share this post


Link to post
Share on other sites
Danny
Hi Peter, Never used YARP, so I'm not sure if this will work or not but there's no harm in trying: [code]add_action('pagelines_loop_after_post_content','myCode'); function myCode(){ related_posts() }[/code] Remember, my PHP skills are legendary for being poor!

Please search our forums, before posting!

Share this post


Link to post
Share on other sites
peterb
Thanks Danny, but nope, didn't work. Still getting the same error.

Share this post


Link to post
Share on other sites
Simon
Your missing a colon after related_posts() ;) should be related_posts(); Also best to wrap plugin functions inside a function_exists() check, then if you dosable the plugin your site wont explode: [code]add_action('pagelines_loop_after_post_content','myCode'); function myCode(){ if ( function_exists( 'related_posts' ) ) { related_posts(); } }[/code]

Share this post


Link to post
Share on other sites
peterb
Thanks Danny, a step in the right direction. Now the code is showing, but I want it only to be in the postloop, that is only in single posts. I just viewed a category page on my site, and YARPP displays its related posts there also. Quite a nuisance.

Share this post


Link to post
Share on other sites
peterb
Sure Catrina: http://einstein.is/category/ios/iphone/ It's happening because I want my category lists to display full content posts, since I always have the classic <--more--> code on all my posts.

Share this post


Link to post
Share on other sites
kastelic
If you want it to display only on single posts you can add a conditional like this: [code]add_action('pagelines_loop_after_post_content','myCode'); function myCode(){ if ( function_exists( 'related_posts' ) && is_single() ) { related_posts(); } }[/code]

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  

×