Category, subcategory and Post Links

Support MB Views Category, subcategory and Post Links

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #29826
    FernandoTWEFernandoTWE
    Participant

    Is it possible to create this structure with MB views?
    I don't see the option to choose a subcategory.

    <ul>
            <li>Category 1</li>
            <ul>
               <li>Subcategory 1</li>
               <ul>
                <li>Post 1</li>
                <li>Post 2</li>
                <li>Post 3</li>
                <li>Post 4</li>
               </ul>
               <li>Subcategory 2</li> 
               <ul>
                <li>Post 1</li>
                <li>Post 2</li>
                <li>Post 3</li>
                <li>Post 4</li>
               </ul>
            </ul>
            <li>Category 2</li>
            <ul>
                <li>Subcategory 3</li>
                <ul>
                 <li>Post 1</li>
                 <li>Post 2 </li>
                 <li>Post 3</li>
                 <li>Post 4</li>
                </ul>
                <li>Subcategory 4</li> 
                <ul>
                 <li>Post 1</li>
                 <li>Post 2</li>
                 <li>Post 3</li>
                 <li>Post 4</li>
                </ul>
             </ul>
    #29841
    Long NguyenLong Nguyen
    Moderator

    Hi,

    There is no prebuilt option that supports showing the list categories and sub-categories like that. You can follow this documentation to run a PHP function in View
    https://docs.metabox.io/extensions/mb-views/#running-php-functions

    then get the categories by using the function get_terms() or get_categories().

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.