Jump to content
Sign in to follow this  
nrbeatty

Carousel template for Posts Page

Recommended Posts

nrbeatty

Hi Pagelines! I've configured a static "Home" page and my posts set to a page titled "News." On this News page, I have the template set to "Carousel Standard" and "post thumbnails" on the page settings, but the carousel does not display. At first it displayed the Feature box, so I unchecked "Show Feature Box on Posts page," and now it looks like a default page. No carousel, despite the page template. aocpmr(dot)net/news Thanks, Nick

Share this post


Link to post
Share on other sites
cmunns

That page is actually set to the default template otherwise it wouldn't be showing the news items. If you want the carousel above that page we will to modify some files.

Share this post


Link to post
Share on other sites
nrbeatty

Hi Adam, With the carousel set as "Thumbnail Posts," the most ideal place to use that config is for the Posts page- e.g. 10 post excerpts on the page with the carousel of thumbnails on top- that's perfect. Is it possible? I would very much like that usability, and I imagine it would be a popular option if available. Thank you for your assistance and replies- it is most helpful. I'm just getting off the ground with the theme, so I will have more questions in the next few weeks that I will after that. Hopefully they're reasonable questions that aren't already answered in the forums...

Share this post


Link to post
Share on other sites
cmunns

Okay well first you have to add to the "modules with javascript" section in the header.php file You should have something that looks like this or refers to the init_carousel `<?php if((is_home() || is_page_template('page-carousel.php') || is_page_template('page-carousel-full.php')) && VPRO) get_template_part ('core/inits/init_carousel');?>` In the code above I've added `is_home()` and you'll have to do the same. THen do pretty much the same thing for line 8 in template_posts.php

Share this post


Link to post
Share on other sites
nrbeatty

Adam, I did exactly what you said to the header.php, but just wanted to double-check if what I did to template_posts.php is correct? if(is_home() || is_page_template('page-carousel.php') || is_page_template('page-carousel-full.php')) $carousel_page = true; else $carousel_page = false; After I made those two changes, I see a carousel at the top of my posts ("News") page, BUT it is showing a flickr gallery even though I have the page options configured for postthumbs. I think this speaks to a larger problem- none of the page settings work: I also have a specific sidebar selected, and it is overridden as well. So rather than tweak the code to fix the carousel, is there a way to edit the code to tell it "Treat the posts page like any other page, including the page options that are selected..." Thank you, Nick

Share this post


Link to post
Share on other sites
cmunns

The posts page has to be handled globally that's why page-by-page options don't work with it, but we can fix in the same as before (with a conditional) In template_carousel.php line 13 just needs to be this `if((m_pagelines('carousel_mode', $post->ID) == 'posts') || is_home()):?>`

Share this post


Link to post
Share on other sites
nrbeatty

Thanks, I got the carousel to be postThumbs. However, from the news page, as soon as you click on a post or thumbnail or thumbnail, and you go to the single post, the carousel disappears. Do I have to edit the code for single-post pages too? And if I want my News/Blog page and the single posts page to have a sidebar that is not the default sidebar, do I have to edit that code? Nick

Share this post


Link to post
Share on other sites
bryan-hadaway

Yes, you'd want to add the code to "single post" template as well. For having a different sidebar for the blog page and subsequent single post pages, let me know just what you want for them and that can handled easily via CSS. Thanks, Bryan

Share this post


Link to post
Share on other sites
nrbeatty

I appreciate your help, but I've been defeated by code here... I'm not sure how to carry out what I need to do. Right now, my posts page has "thumbnail carousel" and I need single-posts to have that same "thumbnail carousel." This is the code for the single.php:

<?php
	    get_header();
	    include(THEME_LIB.'/template_posts.php');
	    get_footer();
	?>

It seems like I would need to modify the template_posts.php file, but I thought Adam already told me to do "pretty much the same thing to Line 8" of that file, which I did. Thanks for your help. I realize you guys could do this in 2 secs, and it takes us forever...

Share this post


Link to post
Share on other sites
cmunns

the `is_home()` conditional will give you what you want on the home page...to have it also on the single post pages you again just add to the same areas you did before but this time the conditional will be `is_single()`

Share this post


Link to post
Share on other sites
cmunns

for example `if((m_pagelines('carousel_mode', $post->ID) == 'posts') || is_home() || is_single()):?>`

Share this post


Link to post
Share on other sites
nrbeatty

Excellent- it worked. The carousel:postThumbs now shows up atop my "blog" page and single-post pages, making a logical and interesting GUI for the user! Thanks for your patience and assistance.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×