Custom Query Blocks

A small collection of blocks to assist with common queries with regards to custom post types and terms.

Choose between displaying a grid of posts, a grid of terms, or featured posts by category.

Blocks

The plugin currently comes with three blocks.

Custom Post Types Block
Custom Post Types Block
Featured Posts by Category Block
Featured Posts by Category Block
Term Grid Block
Term Grid Block

Testimonials

Really like this plugin it has all the features that you need for you posts you be displayed nicely on your website! Excellent support with fast updates!

The way WP handles archives natively is pretty cumbersome and nostalgic of the old blog days, imho. The easy templating of archive pages is one of the major appeals of the big page builders (that should not be named).

Enter this plugin! Makes setting a static page as post archive a breeze and even includes a handy block to display posts at your will.

What makes this plugin even more appealing is the fact that the plugin author is handing out free support and is open for suggestions for future development.

Thanks, Ronald! I hereby present you with the underrated plugin of the year award!

This plugin is exceptional.

This is a fantastic plugin! It should be part of core!

It’s an awesome block, flexible and super customizable. Very useful to build customized archived pages. I was looking for this exact thing and it took me long to find it. I think it deserves more attention and probably better branding or renaming.

I use the Archive Mapping and Post Selector Gutenberg Block on multiple sites. It contains many options and gives me a good control of what I want to see in the post preview list.

Frequently Asked Questions

I have a bug or feature request...
I don't see the post types. What's wrong?
Can you do posts instead of pages for mapping?
Does this plugin work with term (e.g., category) archives?
I need help. Can you help me?
How do I add more fonts?

Developers

Hooks

Add Fonts

The plugin comes with several default fonts. It also supports the Adobe Fonts plugin without any extra programming.

Here's an example of adding more fonts, such as a Google Font.

<?php
add_filter( 'ptam_fonts', function( $fonts ) {
    $fonts['open sans'] = 'Open Sans';
    return $fonts;
} );

Remove Page Column

You can remove the archive mapping column from the page's screen by using the following filter:

<?php
add_filter( 'ptam_add_pages_column', '__return_false' );

Disable Image Sizes

The plugin creates two image sizes. Here's how to disable them programmatically.

<?php
add_filter( 'ptam_add_image_sizes', '__return_false' );

Customize Custom Field Output

The Custom Post Types block supports custom fields, but maybe you need to customize the output?

<?php
/**
 * Filter the custom field value.
 *
 * Filter the custom field value.
 *
 * @since 3.0.0
 *
 * @param mixed  $custom_field_value The custom field value.
 * @param string $maybe_custom_field The custom field name.
 * @param int    $post_id            The Post ID.
 */
$custom_field_value = apply_filters( 'ptam_custom_field', $custom_field_value, $maybe_custom_field );
<?php
add_filter( 'ptam_custom_field', function( $value, $custom_field_name, $post_id ) {
    if ( 'my_field' === $custom_field_name ) {
        return 'new value';
    }
    return $value;
},10, 3);

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top