Displaying pages in the slider and displaying the slider on all pages
-
So, I added the following codes to my functions.php file:
function graphene_display_slider(){
graphene_slider();
}
function graphene_scrollable() {
$interval = (get_option('slider_speed')) ? get_option('slider_speed') : 7000;
?>
<!-- Scrollable -->
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function($){
$(function() {
// initialize scrollable
$("#slider_root").scrollable({circular: true}).navigator({
navi: ".slider_nav",
naviItem: 'a',
activeClass: 'active'
}).autoscroll({interval: <?php echo $interval; ?>});
});
});
//]]>
</script>
<!-- #Scrollable -->
<?php
}To display the slider on all pages and:
function graphene_custom_slider_post_type(){
$post_type = array('post', 'page');
return $post_type;
}
add_filter('graphene_slider_post_type', 'graphene_custom_slider_post_type');To display pages in the slider instead of posts.
Unfortunately, when I added the code to display the slider on all pages, it made the code to display pages instead of posts not work. So I’m getting an empty slider, but it does appear on all pages. I am the newbsauce at php – help?
By the way, I TOTALLY forgot to mention that I am totally in love with this theme and think it’s absolutely brilliant work!
You should be able to display posts AND pages in the slider without the need of an extra function. You should select the option to show “specific posts/pages”. And just enter the numbers of the ID’s of the posts/pages you want to display in the slider.
Hi, Josh!
I would think so, too, but I’m not really sure where to find my page id – it’s not in the page address since I’m using the page name as the permalink and I confess to being stumped. Both code snippets I found in the forums here and they work individually but not together.
Thank you!
Go to your admin panel… and then click on either “Posts” or “Pages”. Now, hover over a post or page title… DON’T click it, just hover.
Now, look toward the bottom-left of your screen and you should see a link. In this link is something like “post=538”. That is the ID number.
NOTE: Both posts AND pages will use “post=”, so don’t get confused.
Awesome, thank you so much! I probably could have done some more thorough testing before coming in here.
So, using the page ids worked like a charm, but when I add the second block of code, my slider becomes empty but it does appear on all pages.
When I remove the second block of code, the sliders behaves absolutely perfectly – but only on the home page. I’m here if it helps at all: http://www.inkwellinternational.com
Thanks again, I really appreciate the help!
What is it you are trying to do? Do you want the slider on ALL pages in a widgit area? Do you want to display different posts/pages in each slider, or the same post/pages in all the sliders?
I suppose I look like a nutter at this point, eh? I’m trying to get the slider into the widget area (sidebar) for all pages. In the slider, I would like only 4 pages to cycle through – the same ones on every page.
Lol… no, you’re fine.
I’m not too sure on the best way to customize the default graphene slider to accomplish your specific task. I’ll wait and see if the mods might have a suggestion.
In the meantime, you can always use a plugin. You can find a list of slider plugins Here. Just remember to install them one at a time and fully test, before moving to another one.
It would be pretty sweet if it’s doable! Looking through the other sliders (and I may be biased at this point) none of them quite live up to Graphene’s. But we’ll see what happens. 😉
Viewing 10 posts - 1 through 10 (of 12 total)
- 1
- 2
- You must be logged in to reply to this topic.