Fabric theme homepage slider?

Community Forums Forums Design Tips and Tricks Fabric theme homepage slider?

This topic is: not resolved

This topic contains 16 replies, has 3 voices, and was last updated by  braddalton 1 year, 7 months ago.

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

    vanhovland
    Participant
    Post count: 10

    Hi I have begun building a site using Fabric: http://96.127.180.186/~mvmontes/

    I would like to add a slider to the homepage similar to this site: http://www.yourecofriend.com/

    Can anyone point me in the right direction?

    Thanks!

    #29409

    Carolyn
    Participant
    Post count: 35

    Here’s what I did.

    I added a widget area just below the secondary navigation.
    To the function.php I add the code

    /** Register widget areas */
    genesis_register_sidebar( array(
    ‘id’ => ‘home-top’,
    ‘name’ => __( ‘Home Top’, ‘fabric’ ),
    ‘description’ => __( ‘This is the top section of the homepage’, ‘fabric’ ),
    ) );

     

    Then I created a home.php and added

    <?php
    /** Add home top widget area */
    add_action( ‘genesis_after_header’, ‘home_top’ );

    function home_top() {
    dynamic_sidebar( ‘home-top’ );
    }

    genesis();

     

    After that I went to Appearances > Widgets

    and in my new widget area Saw there was an area called Home Top.
    In that widget, I put the Genesis Responsive Slider.

    #29411

    vanhovland
    Participant
    Post count: 10

    when I try to add that code to my function.php I get this:

    Parse error: syntax error, unexpected T_STRING in /home/mvmontes/public_html/wp-content/themes/fabric/functions.php on line 39

    #29413

    Carolyn
    Participant
    Post count: 35

    Check that you aren’t missing a semi-colon or something in the code.

    #29429

    vanhovland
    Participant
    Post count: 10

    Thanks for your help so far, but I am still having problems, I am copying and pasting your coding from above:

    /** Register widget areas */
    genesis_register_sidebar( array(
    ‘id’ => ‘home-top’,
    ‘name’ => __( ‘Home Top’, ‘fabric’ ),
    ‘description’ => __( ‘This is the top section of the homepage’, ‘fabric’ ),
    ) );

    and I keep getting errors and have to restore my function.php through my file manager. I am fairly new to coding, so I am not sure how to check what it wrong.

    #29434

    braddalton
    Participant
    Post count: 10253

    Delete that code and add this to the end of your child themes functions.php file.

    Grab the raw version of the code please.

    https://gist.github.com/5198288.git


    #29439

    vanhovland
    Participant
    Post count: 10

    Thanks Brad…I am almost there. Added the genesis slider. Only shows up if I list it as a post page, rather than a static one. Will the slider show up on a static front page or do I need to change something on the page that I want as the static one?

    Thanks again everyone for the help!

    #29442

    Carolyn
    Participant
    Post count: 35

    Okay, so I’m new to it and I added a slider the way I wrote, but I’d go with Brad’s since he is probably more experienced.

    Brad – what is your code? Maybe I should change mine.

    #29444

    braddalton
    Participant
    Post count: 10253

    Hi Carolyn and @vanhovland.

    I just wrote that code for the home page but its really flexible. You can change the conditional tag to display based on any conditions and change the output based on the genesis hook locations.

    Let me know exactly what you want and i’ll modify it on git.

     

    P.S Always grab the raw version of the code.


    #29448

    vanhovland
    Participant
    Post count: 10

    Brad,

    What I am wanting is a static front page (welcome is what I have called mine), that has the slider on it. Do I need to have a home.php file as Carolyn suggested, or just add the coding to the function.php. Does what I am wanting make sense?

    Thanks, Heidi

    #29453

    Carolyn
    Participant
    Post count: 35

    Here’s where I am

    http://todd.carolyncreates.com/

    I’ve got the Genesis Slider in, but have space between the subnav and slider. I’ve also tried to update the slider but it won’t (another topic)

    Should I change my code from above to the one you listed?

    #29455

    braddalton
    Participant
    Post count: 10253

    That’s what the code does. It outputs the widget content on the home page only, in this case the slider and displays it full width before the content using the before content sidebar wrap hook.

    Paste the raw version of the code at the end of your child themes functions.php file.

    No home.php needed nor is it best practice to edit template files unless they are in the child theme.

    Keep all custom coding in the child themes style.css and functions.php files.


    #29457

    vanhovland
    Participant
    Post count: 10

    Great, that is clear, no home.php needed.

    The slider still only works when front page – your latest posts is selected. Will it work on a static front page as well?

    #29458

    Carolyn
    Participant
    Post count: 35

    Great, thanks Brad. I’ve now subscribed to your feed. I’m sure I’ll learn a lot!

    #29461

    braddalton
    Participant
    Post count: 10253

    Yeah mostly Genesis Tutorials and code snippets at the moment so it should be useful Carolyn.


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

You must be logged in to reply to this topic.