• Resolved c-m

    (@c-m)


    How do I choose the which grid layout will used when using template tags?

    And also how do I limit the images displayed to just those from a specific page or category?

    This is the current code I have on my static homepage:

    <?php
    the_wp_tiles( array(
            'grids' => true,
        'grid' => 'Plain',
         'full_width'    => false
    ) ); ?>

    I want to use a grid layout called Plain and also limit the output to images from category 67.

    Thanks in advance

    https://www.ads-software.com/plugins/wp-tiles/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter c-m

    (@c-m)

    Ok I’ve made some more progress with:

    <?php
    
    $query = new WP_Query(array(
    'post_type' => 'post',
    'posts_per_page' => 4,
    'paged' => 1
    ) );
    // WP Tiles arguments
    $args = array(
    'grids' => plain
    );
    // Display the tiles
    the_wp_tiles( $query, $args );
    ?>

    All I need to now to limit the output to images from my gallery category or pages.

    Plugin Author Mike Martel

    (@mike_cowobo)

    Hi @c-m,

    Check out the docs of WP_Query for extra info on querying categories: https://codex.www.ads-software.com/Class_Reference/WP_Query#Category_Parameters

    Basically, if you add the cat argument, you can query by category ID:

    $query = new WP_Query(array(
        'post_type' => 'post',
        'posts_per_page' => 4,
        'paged' => 1,
        'cat' => 67
    ) );

    Cheers,
    Mike

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Choosing the grid layout with template tags and limiting resources’ is closed to new replies.