Community Forums › Forums › Archived Forums › Design Tips and Tricks › Adding Slideshow To Lifestyle Home Page php
- This topic has 14 replies, 2 voices, and was last updated 11 years, 10 months ago by Jen Baumann.
-
AuthorPosts
-
January 7, 2013 at 7:22 pm #10248TonySan1Member
Hi all, I hope you all are doing well. My name is Tony and I am new to the forum. I am having big fun making small changes to my new Lifestyle theme. I really no nothing about coding so I am somehow stumbling through it all. I was hoping to get a little help here if possible. I would like to know if some one could instruct me or direct me to the needed information regarding how to add my slideshow .php or shortcode to my Lifestyle Theme home page only. I have a slideshow plugin that has generated the .php code and shortcode for the slideshow all I need now is to know where to insert the code to put the slideshow on top of my home page beneeth the header and above the first post excerpt. Any help would be graetly appreciated. 🙂
Thank You,
TonySan1
January 8, 2013 at 2:51 pm #10444Jen BaumannParticipantIf you edit your home.php file, which is located in the lifestyle child theme folder, the slideshow will display on the homepage only.
Since you have a shortcode and you haven't provided the code you need to add, I'd recommend trying this (Codex):
echo do_shortcode( '[whatever_shortcode]' );
You'll see the function in the home.php file similar to this:
function lifestyle_home_loop_helper() { if ( is_active_sidebar( 'home' ) || is_active_sidebar( 'home-left' ) || is_active_sidebar( 'home-right' ) ) { dynamic_sidebar( 'home' ); if ( is_active_sidebar( 'home-left' ) ) { echo '<div id="homepage-left">'; dynamic_sidebar( 'home-left' ); echo '</div><!-- end #homepage-left -->'; } if ( is_active_sidebar( 'home-right' ) ) { echo '<div id="homepage-right">'; dynamic_sidebar( 'home-right' ); echo '</div><!-- end #homepage-right -->'; } } else { echo do_shortcode( '[whatever_shortcode]' ); genesis_standard_loop(); } }
If you have questions in the future, it's always easier for the community to help if you provide a url.
January 8, 2013 at 5:32 pm #10494TonySan1MemberThank you Jennifer for your help. I added the code provided and I then recieved an error message. "Parse error: syntax error, unexpected T_LNUMBER in /home/moneybiz/public_html/wp-content/themes/lifestyle/home.php on line 28"
This is the code I inserted. is this correct, or did I miss something? "echo do_shortcode( '[slideshow_deploy id='246]' );"
Since that is where I inserted the code I am assuming that it won't work and I need to find another solution.
By the way you can view my site at. http://internetbusinessmastery.info
January 8, 2013 at 5:41 pm #10498Jen BaumannParticipantTry this. Looks like you had an extra '
echo do_shortcode( '[slideshow_deploy id=246]' );
January 8, 2013 at 7:23 pm #10545TonySan1MemberInserted the new code I don't get an error message now but I get this text "!slideshow_deploy!" on the home page where the slideshow should go.
January 8, 2013 at 7:41 pm #10548TonySan1MemberMaybe this will help you help me. 🙂 Here is both the shortcode and php code for my slideshow.
Shortcode Below
[slideshow_deploy id='246']
php below
<?php do_action('slideshow_deploy', '246'); ?>January 10, 2013 at 12:07 pm #11006Jen BaumannParticipantJust replace the do_shortcode with your do_action code. It doesn't appear from that you need to echo it.
do_action('slideshow_deploy', '246');
January 10, 2013 at 12:43 pm #11013TonySan1MemberHi Jen, Thank you so much for hanging in there with me. I am very grateful. That last instruction you gave me did put the slideshow on my home page only as I wanted. I only have one last request can you please tell me how to put a break or space between my slideshow and the top post title?
Again Thank You. 🙂
Tony
January 11, 2013 at 12:18 pm #11284Jen BaumannParticipantYou can add this to style.css
.slideshow_container { margin-bottom: 10px; }
January 11, 2013 at 1:14 pm #11298TonySan1MemberThank you for the reply. Is there any specific place I should add this code in the style.css?
January 11, 2013 at 1:19 pm #11301Jen BaumannParticipantI would just add it at the bottom to make life easy 🙂
January 11, 2013 at 1:43 pm #11306TonySan1MemberHi Jen, I did as you instructed and there was no change to the slideshow or space added. I really hope that I am not being a bug. If I am I apologize for it.
January 11, 2013 at 1:46 pm #11308Jen BaumannParticipantMake sure you clear your total cache. I do see a change. If you want to make it more drastic, increase 10px to something higher. 20px maybe?
January 11, 2013 at 2:03 pm #11310TonySan1MemberI do see the change now and it is just what I wanted to do. I can't than you enough for all of your help. You have made my day! 🙂
Warm regards
Tony
January 11, 2013 at 2:30 pm #11315Jen BaumannParticipantYou're very welcome!
-
AuthorPosts
- The topic ‘Adding Slideshow To Lifestyle Home Page php’ is closed to new replies.