Jump to content


Photo
- - - - -
Resolved

exclude categories from carousel

exclude categories carousel

This topic has been archived. This means that you cannot reply to this topic.
8 replies to this topic

#1 gavin_launchpad

gavin_launchpad

    Advocate

  • Members

  • 509 posts

Posted 19 September 2012 - 03:21 PM

Hi

we would like to globally exclude categories from appearing in the carousel. we have about 30 categories and there are 8 that we need to exclude.

Please Login or Register to see this Hidden Content


i found this on another thread

Please Login or Register to see this Hidden Content

and was wondering if it could be tailored to achieve the exclusion in carousels.

Thanks

#2 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts

Posted 19 September 2012 - 10:18 PM

It probably can be used that way Gavin, but it would take a developer with skills in functions and hooks to craft it properly. Doing it wrong could break your site, as I'm sure you know. I understand you've done some seriously good coding in past and imagine this isn't beyond your reach, given the fact that you have an example of the hook.

#3 gavin_launchpad

gavin_launchpad

    Advocate

  • Members

  • 509 posts

Posted 13 October 2012 - 01:50 PM

can anyone advise on how the carousel can be targeted correctly?

thanks

#4 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts

Posted 13 October 2012 - 07:43 PM

Gavin, I am unsure of how to exclude a category, except for a method I didn't think you'd like. So, let me offer it anyway and let you make your own choice.

In your site, create a new category... for the sake of this example, we will call the category "carousel".

For each post you want to show, add the post to that category. If you have a large volume of posts, you can use an old but still functional plugin called "Batch Cat", available at WP.org.

Then, in the settings for the carousel, rather than exclude, you'd select the carousel category. Only the posts you have added to that category will display, essentially excluding those you do not wish included.

Yes, it's old fashioned thinking, but I'm and old guy.

#5 gavin_launchpad

gavin_launchpad

    Advocate

  • Members

  • 509 posts

Posted 15 October 2012 - 08:15 AM

Hi Rob,

Thanks for your advice, if none of the pagelines developers can advise on how to target the carousel we will look at your suggestion.

We have asked this in the chat service and been advised to ask it here. Hopefully a developer will be along soon.

thanks

#6 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts

Posted 16 October 2012 - 09:39 PM

I have no idea when that might be Gavin, as they usually don't work in here. One's on vacation too. I can't be sure when this might be answered, but did flag it for you.

#7 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts

Posted 16 October 2012 - 10:46 PM

Gavin your filter can be reused, just needs some logic added so it does not hijack the main query ;)

Now let me point out, this is a bit of a hack ;) First you have to set the max carousel images to something random, I chose 17.

Please Login or Register to see this Hidden Content


So the filter checks if were on the frontpage, assume thats where you wanted the carousel, then it looks for numberposts being '17' ;) Without this check it will break the main query for your posts.

#8 gavin_launchpad

gavin_launchpad

    Advocate

  • Members

  • 509 posts

Posted 17 October 2012 - 02:07 PM

Thanks Simon

that has worked perfect.

:)

#9 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts

Posted 17 October 2012 - 02:24 PM

The topic was marked as resolved.