Dear friends:
I need to include some PHP code on the home page. It must go before the Wordpress loop. Can you explain in what file should I include? I can not find the corresponding template file.
Thanks,
Jes??s
Where to put PHP code?
Started by
tramullas
, Apr 09 2012 05:55 PM
8 replies to this topic
#1
Posted 09 April 2012 - 05:55 PM
#2
Posted 10 April 2012 - 03:36 AM
What is the PHP code supposed to achieve? (It's not advisable to edit any of the core files in the theme)
#3
Posted 10 April 2012 - 09:20 AM
I need to control a slider genereted by Power Slider plugin. The code is
1,
'limit' => 10,
'width' => 600,
'height' => 300,
'style' => 'white', // 'white', 'none'
'animation' => 'fade', // 'fade', 'horizontal', 'vertical'
'speed' => 600,
'delay' => 4000
) ); ?>
I try it on the base theme functions file, but it crashes...
#4
Posted 10 April 2012 - 09:54 AM
Hi,
What do you when you mean "but it crashes" ?
You would most likely have to add it to the child themes or PageLines customisation plug-in function.php file. You will need to probably add it as a hook, at off like this:
You will also need to use the function is_home, click here for more information.
http://codex.wordpre...ference/is_home
I would also recommend contacting the author of the plug-in too.
What do you when you mean "but it crashes" ?
You would most likely have to add it to the child themes or PageLines customisation plug-in function.php file. You will need to probably add it as a hook, at off like this:
//add_action('pagelines_before_postloop', 'power_slider');
function power_slider(){?>
Code goes here!
You will also need to use the function is_home, click here for more information.
http://codex.wordpre...ference/is_home
I would also recommend contacting the author of the plug-in too.
#5
Posted 10 April 2012 - 04:54 PM
Dear Danny:
When I try to do that, WP says internal server error 500, "...wp-admin/plugin-editor.php?file=pagelines-customize/functions.php&a=te&scrollto=364"
#6
Posted 10 April 2012 - 05:24 PM
Please post the code you are trying to use: http://paste.pagelines.com
#9
Posted 12 April 2012 - 04:25 PM
It works fine, many thanks...











