![]() |
|
||||||
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
I am creating a simple child theme for a site with a few pages.
On this child theme I am trying to implement the use of a plugin, skitter_slideshow. Its a slider plugin that is invoked when you add the following code to posts.php in wordpress: <?php if ( function_exists('show_skitter') ) { show_skitter(); } ?> On the Genesis Framework I have added the following code to my child theme's functions.php file: if ( function_exists('show_skitter')) add_action( 'genesis_after_post_content', 'show_skitter'); This works and invokes the plugin slider. However, it does it for every post and page. My objective is to just have it display on a particular page or post and not any of the other pages or posts in the site. Any suggestions on how I can do that within the framework.
__________________
Vinicius Brasil http://www.mountainviewrealestateguy.com |
|
#2
|
||||
|
||||
|
You can make your code conditional
http://nickc.co/conditional-content
__________________
Nick "Fred and/or George Weasley" Croft Designs by Nick the Geek @Nick_theGeek on Twitter Make web design easier, get FireBug for FireFox Want to learn more about Genesis? Check out my Genesis Explained Series |
|
#3
|
|||
|
|||
|
Thanks for the response Nick. I read the post, it seemed very clear and made sense to me. I was just testing the logic, perhaps my PHP is not correct, but I didn't work for me in my application. Can you please take a look at the code and let me know if I am doing anything wrong.
if (is_page() && is_category('photo')) { if ( function_exists('show_skitter')) add_action( 'genesis_after_post_content', 'show_skitter'); } My site http://www.missionplacehomes.com is just made up of several pages. One page I put under the category photo but it didn't work. To troubleshoot I then tried to simplify it to: if (is_page() ) { if ( function_exists('show_skitter')) add_action( 'genesis_after_post_content', 'show_skitter'); } And this had no effect either. I am obviously doing something wrong, but its not obvious to me what it is. Please let me know if you know. Thanks
__________________
Vinicius Brasil http://www.mountainviewrealestateguy.com |
|
#4
|
||||
|
||||
|
this needs to be added differently. The is_page/is_category conditionals don't have anything to work with till after teh query is built.
PHP Code:
__________________
Nick "Fred and/or George Weasley" Croft Designs by Nick the Geek @Nick_theGeek on Twitter Make web design easier, get FireBug for FireFox Want to learn more about Genesis? Check out my Genesis Explained Series |
|
#5
|
|||
|
|||
|
That worked perfectly, thanks Nick. I am currently reading your Genesis Framework Explained Series, very enlightening.
I am trying to do one more thing. I want to remove the author and date info after the post. I am trying to find the hook and function that it pertains to. My methodology is to look in the post.php file. And I thought I found it but I was wrong since my change did nothing. what I added to my child functions.php file was: remove_action( 'genesis_after_post_content', 'genesis_post_meta' ); I then created a post.php file and added the same action above, and no change. Basically I looked for the action I thought added in the function and just removed it, but that didn't work. Do I have the right idea here? I am having a difficult time finding this, any tips on how to locate these actions for future reference.
__________________
Vinicius Brasil http://www.mountainviewrealestateguy.com |
|
#6
|
||||
|
||||
|
looks right in theory, please start a new thread and we can help out. Thanks
You're welcome. Since this is resolved I'm going to close this thread.
__________________
Nick "Fred and/or George Weasley" Croft Designs by Nick the Geek @Nick_theGeek on Twitter Make web design easier, get FireBug for FireFox Want to learn more about Genesis? Check out my Genesis Explained Series |
| Thread Tools | |
| Display Modes | |
|
|
© Copyright 2012 Copyblogger Media LLC · StudioPress™ is a trademark of Copyblogger Media LLC
Privacy Policy | Refund Policy | Terms of Service | Affiliate Program | Contact Us