Community Forums › Forums › Archived Forums › Design Tips and Tricks › Fabric theme homepage slider?
- This topic has 16 replies, 3 voices, and was last updated 11 years ago by Brad Dalton.
-
AuthorPosts
-
March 19, 2013 at 9:42 am #29407vanhovlandMember
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!
March 19, 2013 at 10:00 am #29409CarolynMemberHere'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.March 19, 2013 at 10:15 am #29411vanhovlandMemberwhen 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
March 19, 2013 at 10:22 am #29413CarolynMemberCheck that you aren't missing a semi-colon or something in the code.
March 19, 2013 at 11:45 am #29429vanhovlandMemberThanks 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.
March 19, 2013 at 11:57 am #29434Brad DaltonParticipantDelete 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
March 19, 2013 at 12:04 pm #29439vanhovlandMemberThanks 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!
March 19, 2013 at 12:10 pm #29442CarolynMemberOkay, 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.
March 19, 2013 at 12:16 pm #29444Brad DaltonParticipantHi 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.
March 19, 2013 at 12:24 pm #29448vanhovlandMemberBrad,
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
March 19, 2013 at 12:35 pm #29453CarolynMemberHere'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?
March 19, 2013 at 12:35 pm #29455Brad DaltonParticipantThat'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.
March 19, 2013 at 12:40 pm #29457vanhovlandMemberGreat, 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?
March 19, 2013 at 12:40 pm #29458CarolynMemberGreat, thanks Brad. I've now subscribed to your feed. I'm sure I'll learn a lot!
March 19, 2013 at 12:44 pm #29461Brad DaltonParticipantYeah mostly Genesis Tutorials and code snippets at the moment so it should be useful Carolyn.
March 19, 2013 at 12:50 pm #29464CarolynMemberProbably VERY USEFUL. I'm in the beginning (hacking) stages so I'm trying to learn as much as possible.
Do you post much on G+?
I'll follow you there too if you do.
March 19, 2013 at 12:54 pm #29465Brad DaltonParticipant -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.