Adding Slideshow To Lifestyle Home Page php

Community Forums Forums Design Tips and Tricks Adding Slideshow To Lifestyle Home Page php

This topic is: resolved

This topic contains 14 replies, has 2 voices, and was last updated by  Jen Baumann 1 year, 6 months ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #10248

    TonySan1
    Participant
    Post count: 20

    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

    #10444

    Jen Baumann
    Keymaster
    Post count: 323

    If 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):
    [php]echo do_shortcode( ‘[whatever_shortcode]‘ );[/php]

    You’ll see the function in the home.php file similar to this:
    [php]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();
    }
    }[/php]

    If you have questions in the future, it’s always easier for the community to help if you provide a url.


    If you need technical support for your theme please file a ticket.

    The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.

    #10494

    TonySan1
    Participant
    Post count: 20

    Thank 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

    #10498

    Jen Baumann
    Keymaster
    Post count: 323

    Try this. Looks like you had an extra ‘
    [php]echo do_shortcode( ‘[slideshow_deploy id=246]‘ );[/php]


    If you need technical support for your theme please file a ticket.

    The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.

    #10545

    TonySan1
    Participant
    Post count: 20

    Inserted 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.

    #10548

    TonySan1
    Participant
    Post count: 20

    Maybe 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′); ?>

    #11006

    Jen Baumann
    Keymaster
    Post count: 323

    Just replace the do_shortcode with your do_action code. It doesn’t appear from that you need to echo it.

    [php]do_action(‘slideshow_deploy’, ’246′);[/php]


    If you need technical support for your theme please file a ticket.

    The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.

    #11013

    TonySan1
    Participant
    Post count: 20

    Hi 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

    #11284

    Jen Baumann
    Keymaster
    Post count: 323

    You can add this to style.css

    [css].slideshow_container {
    margin-bottom: 10px;
    }[/css]


    If you need technical support for your theme please file a ticket.

    The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.

    #11298

    TonySan1
    Participant
    Post count: 20

    Thank you for the reply. Is there any specific place I should add this code in the style.css?

    #11301

    Jen Baumann
    Keymaster
    Post count: 323

    I would just add it at the bottom to make life easy :)


    If you need technical support for your theme please file a ticket.

    The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.

    #11306

    TonySan1
    Participant
    Post count: 20

    Hi 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.

    #11308

    Jen Baumann
    Keymaster
    Post count: 323

    Make 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?


    If you need technical support for your theme please file a ticket.

    The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.

    #11310

    TonySan1
    Participant
    Post count: 20

    I 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

    #11315

    Jen Baumann
    Keymaster
    Post count: 323

    You’re very welcome!


    If you need technical support for your theme please file a ticket.

    The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.

Viewing 15 posts - 1 through 15 (of 15 total)

The topic ‘Adding Slideshow To Lifestyle Home Page php’ is closed to new replies.