0
Welcome Guest! Login
0 items Join Now

Recent Posts Widget Displaying All Categories

  • Recent Posts Widget Displaying All Categories

    Posted 11 years 10 months ago
    • I am trying to use the Gantry Recent Posts widget in a WP / Gantry installation. One of the fields asks to indicate which Category you wish to pull the posts from (a great feature I think). However it is pulling all posts from al categories, much like the standard WP widget.

      Anyone have any experience with this issue?

      WP 3.4.1 - Gantry v1.24
    • Cliff Pfeifer's Avatar
    • Cliff Pfeifer
    • Preeminent Rocketeer
    • Posts: 8444
    • Thanks: 20
    • Website Developer

    Re: Recent Posts Widget Displaying All Categories

    Posted 11 years 10 months ago
    • Hi, basically, what you enter in that field needs to be in the correct format for Wordpress to understand it, just as you would use if you were creating a custom WP_Query code. What happens is the field turns into a variable and is output in our WP_Query code that runs the widget.

      All this means in real life is that you need to use the category ID numbers, separated by commas if there is more than one - 21,32,15, ECT. If you want to exclude a category, you use a minus sign before the id number, like -15,-23 and so on.

      Here is a link that describes how this works in WP - basically what follows cat= is the variable you're creating in the widget category field:
      codex.wordpress.org/Class_Reference/WP_Q...#Category_Parameters

      Also a link to help you find category id numbers:
      www.wprecipes.com/how-to-find-wordpress-category-id

      Hope that helps.
    • The following users have thanked you: Michael P

    • The difficult we do immediately, the impossible takes a little longer.
  • Re: Recent Posts Widget Displaying All Categories

    Posted 11 years 10 months ago
    • Thanks for the reply. So would I just enter the ID number, or enter "cat=12", for example.
    • Cliff Pfeifer's Avatar
    • Cliff Pfeifer
    • Preeminent Rocketeer
    • Posts: 8444
    • Thanks: 20
    • Website Developer

    Re: Recent Posts Widget Displaying All Categories

    Posted 11 years 10 months ago
    • Enter just the ID number - all the rest is in the code. We try to make it as easy as possible :)
    • The difficult we do immediately, the impossible takes a little longer.
  • Re: Recent Posts Widget Displaying All Categories

    Posted 11 years 10 months ago
    • Well I think that helped. But I am making a mess of things. I can't seem to get the posts to show up on a page with the proper background or even show up at all when clicking "read more".

      Clearly I am not using the assignments properly.

      www.robertshemin.com/category/newsletters/

Time to create page: 0.051 seconds