Community Forums › Forums › Archived Forums › Design Tips and Tricks › Adding ShortCode to the Homepage
Tagged: shortcode
- This topic has 6 replies, 3 voices, and was last updated 12 years ago by
Brad Dalton.
-
AuthorPosts
-
February 14, 2014 at 5:38 pm #90383
drezac
MemberI'm having trouble adding a jquery custom slider to my Genesis Child theme
The code they gave me is:
<?php echo do_shortcode('[all_around id="1"]'); ?>
I'm trying to insert this on home.php, but getting an error:
Parse error: syntax error, unexpected '<' in /home/content/33/6807133/html/test/wp-content/themes/pintercast/home.php on line 34
Is this how I add shortcode to my Genesis theme, or is there another way?
Thanks!
February 15, 2014 at 2:32 am #90457Davinder Singh Kainth
MemberIf you are adding this code in a widget to execute, then you must use plugin to allow widgets to execute php code - http://www.basicwp.com/run-php-code-wordpress-text-widget/
Sunshine PRO genesis theme
Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis ThemesFebruary 15, 2014 at 9:35 am #90475drezac
MemberThis is not a widget. This is on the main front page. I've looked around and seen some people actually place code in the functions.php to insert their sliders. I tried inserting it on the home.php, but I get an error.
The instructions that came with the slider- were not Genesis friendly.
Dan
February 15, 2014 at 2:22 pm #90530Brad Dalton
ParticipantWhich slider? jquery custom slider
Link to the slider docs please
Here's how its done http://wpsites.net/web-design/executing-shortcodes-in-hook-locations-using-functions/
February 15, 2014 at 2:59 pm #90532drezac
MemberThanks-
It's the All Around WP Slider Carousel. It's fantastic, but hard to squeeze into this theme.
http://www.shindiristudio.com/allaroundslider/?page_id=67
I think you're spot on- the only problem I have, is that the theme I'm using has removed a lot of the Genesis hooks and added their own custom header stuff. You can see that code here: https://gist.github.com/drezac/f6915cb24202d04dc3a5
This is what I was thinking:
function all_around_slider_home() {
if (is_home()) {
echo do_shortcode('[all_around id="1"]');
}
};
/**
* @author Brad Dalton - WP Sites
* @learn more http://wp.me/p1lTu0-9p4
*/
add_action('I_dont_know_what_hook_to_put_here', 'all_around_slider_home');I feel like this is close....
-Dan
February 15, 2014 at 3:46 pm #90534drezac
MemberI added :
function all_around_slider_home() {
if (is_home()) {
echo do_shortcode(‘[all_around id="1"]‘);
}
};
/**
* @author Brad Dalton – WP Sites
* @learn more http://wp.me/p1lTu0-9p4
*/
add_action(‘genesis_after_header’, ‘all_around_slider_home’);Still gets broken....
February 15, 2014 at 4:29 pm #90538Brad Dalton
ParticipantLooks like i resolved this on my site already http://wpsites.net/best-plugins/add-slide-deck-to-any-theme/
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.