Increase Number of Services from 6 to 9

I am currently using the services section in post-mode and would like to be able to show more than 6 featured posts. Is there a way to accomplish this. Also is there a way that a separate category can be assigned to each service box. Thanks so much.

  • Mason
    • DEV MAN’s Sidekick

    Hiya Steven!

    First off, welcome to WPMU DEV! :smiley:

    The number of posts shown using "Post Mode" is hard-coded into the theme. However, you can actually change this limit pretty easily.

    look in your blogs-mu folder for post-mode.php

    Open up the file and look at line 7. Should be:
    $my_query = new WP_Query('category_name='. $tn_blogsmu_home_service_postmode_cat . '&' . 'showposts=' . 6);

    See the number 6 at the end? You can change it to whatever you like and that will dictate how many posts appear when in this mode.

    Hope that helps!

    Thanks and again, welcome! :smiley:

  • Mason
    • DEV MAN’s Sidekick

    Hiya Steven, can we verify that you're using "post mode" and that you already have 7, 9, or 12 posts in that category?

    Also, if you have a link, feel free to post it and I can take a look at it as well. If the above two things are both correct, this should work just fine.


  • Mason
    • DEV MAN’s Sidekick

    Hiya Steven,

    Unfortunately, changing the service-mode is quite a bit more complex. You'd have to look at the service-mode.php file and copy and paste each section (you should see a pattern starting each time at div class="sbox") and rename the variables in this section accordingly (so after 6 would come 7, 8, 9, etc).

    Then you'd need to add them to the services-functions.php file so that the options to create them appear in the admin section. It's a lot of work - especially if you're unfamiliar with this level of editing.

    Truly, I'd recommend switching up and going the post-mode route if you want to have many spots like this. You can give your posts a special category and have the post-mode only pull from this category so that new posts aren't pulled in unless you specifically categorize the post.

    Hope this helps!


  • Richie_KS
    • HummingBird

    hi stevenlpn

    services-mode currently only limit to 6 coz they were hardcoded with the upload images functions.
    but when on post-mode...using mason code should increase the post-count.

    $my_query = new WP_Query('category_name='. $tn_blogsmu_home_service_postmode_cat . '&' . 'showposts=' .6);

    change 6 to any count you want.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.