Category Shortcode – Possible to display results in 2 columns?

  • Amy
    Amy
    Newbie 54 points
    March 8, 2015 at 5:41 pm

    I am currently using this shortcode: [CATEGORIES COUNT=”yes”] on a page to create an index of categories.

    It works perfectly, I just want to make a design change:
    Currently it is displaying the list of categories in 3 columns and I would like to make it 2 columns to fit my page better.

    Can I do this with CSS in the Custom Meta Data (Design Setup) area, or can I use html on the page itself to achieve this? (If so how?)

    Any advice is appreciated.

  • Amy
    Amy
    Newbie 54 points
    March 8, 2015 at 6:25 pm

    After doing some reading/research:

    I tried modifying the file: class_shortcodes.php

    Under this section:
    /* ====================================================
    [CATEGORY] – SHORTCODE =====================================================*/

    $STRING .= ‘<ul class=”col-md-4”><li class=”head”>
    ________________________________________________

    I modified the “col-md-4” to be “col-md-6” as I understand according to the bootstrap documentation this should be two equal columns, however, it changed it to be ONE column when I did this.

    What am I missing?


  • Josh
    Super Guru 13,875 points
    March 8, 2015 at 6:43 pm

    Hello Amy
    Could you provide url

  • Amy
    Amy
    Newbie 54 points
    March 8, 2015 at 7:01 pm

    Hi Josh,

    Every time I ask a question on this forum people want my URL, lol
    I can’t give URL, site is still in development.

    Here is a screen capture showing how the categories are displaying in ONE column after I made the code change to the class_shortcodes.php file as I indicated above.

    As you can see, this would look much better in 2 columns, but it is way too crowded with the default 3 columns. (Since I want to keep the sidebar on this page)

    I thought changing the default “col-md-4” to be “col-md-6” would do the trick, but as you can see, it did not.

    Any ideas?

    Attachments:
    You must be logged in to view attached files.
  • Hemanta Chakladar
    Hemanta Chakladar
    Super Guru 1,710 points
    March 8, 2015 at 11:52 pm

    use this, [TAXONOMY name=’listing’ count=’yes’ icon=’no’ perrow=2]

  • Amy
    Amy
    Newbie 54 points
    March 9, 2015 at 1:24 am

    Thank you Hemanta,
    It kinda worked and kinda didn’t.

    It flowed into 4 colums instead of 2. I changed the perrow number to 1 and then got 3 columns…
    It also scrambled up the order (seemed to be categories with the most listings first etc…) I need it alphabetical. Tried adding order=”desc”, but that didn’t work.

    I switched back to [CATEGORIES COUNT=”yes”] for now as it is better that it be one column and alphabetical, but still not as preferred (2 columns and alphabetical order)
    Hmmmm. Thanks for your reply though, appreciate it.

  • Hemanta Chakladar
    Hemanta Chakladar
    Super Guru 1,710 points
    March 9, 2015 at 1:26 am

    I thought changing the default “col-md-4” to be “col-md-6” would do the trick, but as you can see, it did not.

    Have you done this change ?

  • Amy
    Amy
    Newbie 54 points
    March 9, 2015 at 1:31 am

    Yes I did.
    In class_shortcodes.php under CATEGORIES it is currently set to be “col-md-6”.
    I thought this meant 2 equal columns, but for some reason even after I changed it, it’s giving me only 1 column.

  • Hemanta Chakladar
    Hemanta Chakladar
    Super Guru 1,710 points
    March 9, 2015 at 1:35 am

    set it to default and try the perrow option.

  • Hemanta Chakladar
    Hemanta Chakladar
    Super Guru 1,710 points
    March 9, 2015 at 1:38 am

    it orders by number of listing. To order it by alphabetically, use plugin

Viewing 10 posts - 1 through 10 (of 10 total)

New Business Themes for WordPress 2020

Start your new website today!

View Business Themes