Category: Query

  • QueryLoop: Featured Cards

    QueryLoop: Featured Cards

    Overrides the query loop block to work with T2 while also removing clutter. Supports multiple post types. Customizable through library.json.

    Customizing the block

    This block can be customized using the library.json file. The following options are available:

    • __experimentalMultiplePostTypes (bool): Whether to allow multiple post types. Default: false.
    • template (array): The innerblocks template.
    • allowedControls (array): The allowed controls for the block See list, To see the post per page use postCount to see full list of available controls see the code as documentation is not complete Link
    • defaultQuery (array): The default query for the block.
    • defaultVariationTitle (string): The title that will be outputted for the block.
    • defaultVariationDescription (string): The description that will be outputted for the block.
    • allowedColumns (array): The allowed columns for the block.

    See more details: https://github.com/DekodeInteraktiv/dekode-library/tree/main/library/featured-cards-loop

  • Dekode Post, Term and Meta Blocks

    Dekode Post, Term and Meta Blocks

    A WordPress plugin that provides blocks and block variations for rendering post propertiesterm properties, and meta fields directly in the block editor and on the front end. Per Egil Roksvaag is the owner of this plugin and responsible for maintenance and support.

    Reason Why

    WordPress ships with a set of post blocks (core/post-titlecore/post-excerptcore/post-featured-image, etc.) and a similar set of term blocks (core/term-namecore/term-descriptioncore/term-archive-link, etc.). Use these core blocks whenever they cover your needs.

    However, there are some cases where the core blocks fall short and you need enhanced features for displaying post, term or meta data:

    • Meta fields — Display registered post or term meta fields.
    • Additional properties — Show post and term properties not covered by core blocks, e.g. post type, post status or taxonomy name.
    • Display a post’s terms — Show term properties related to the current post in a term query loop or a single post template.
    • Display a term’s posts — Show post properties related to the current term in a term query loop or a single term template.
    • Post or term buttons — Render a post, term or meta field as a core button with dynamic text and link.
    • Post or term images — Render a post, term or meta field as a core image. In contrast to the core featured image block, it can display a fallback image when no featured image is set.
    • Filters and hooks — Backend and editor hooks for displaying custom properties or modifying the output.

    This plugin also provides a Text Group helper block for combining multiple post or term properties into a single line of text. Inside the group, you can use the included Inline Text block to insert static text or separators between the dynamic properties.

    Blocks and Variations

    dekode-library/post-property-text

    Renders a single post property — title, excerpt, date, author, type, status, slug, link, featured image ID, or any meta field — as text. Supports prefix, suffix, separator, tag name, text alignment, and optional linking to the post. Server-side rendered.

    dekode-library/term-property-text

    Renders a single term property — name, description, archive link, slug, ID, count, taxonomy name, or any meta field — as text. Supports prefix, suffix, separator, tag name, text alignment, and optional linking to the term archive. Server-side rendered.

    dekode-library/text-group

    A layout container block for grouping multiple text property blocks. Supports inline and block layouts with configurable gap. Inner inline-text blocks can be nested freely within the group.

    core/button — Post Property and Term Property variations

    Two variations of the core Button block that replace button text and the link URL with a resolved post or term property. The button text and link are rewritten server-side via WP_HTML_Tag_Processor, preserving all block markup and editor styles.

    core/image — Post Property and Term Property variations

    Two variations of the core Image block that replace the image source with a resolved post or term property (e.g. featured_media or a meta URL field). Server-side rendered.

    For more details see docs:
    https://github.com/DekodeInteraktiv/dekode-library/tree/main/library/dekode-post-blocks

  • Query block extended

    Query block extended

    There is no dedicated time for this. So I did it in spare time …
    So sorry for any issue, please report in gitHub any issue if find.

    All elements supports interactivity navigation.

    Styling is really basics just to have something, and cover at least plug-in solutions.

    NOTE: Filters relation is AND

    Key features

    • Search
    • Clear filters –
      • It also fetch the core button regsitered styles and apply to button (outline is buggy in backed due to how WP handles it)
    • Taxonomy filters
      • WP Query block setting aware! – If you select some filtered categories in query it will pick only one that are selected!
    • Order
    • Author
    • Load more
      • Button load more
        • It also fetch the core button regsitered styles and apply to button (outline is buggy in backed due to how WP handles it)
      • Infinity load more
    • Chips
    • Mobile collapse per filers/group filters
    • Post type – Require Library extension to support multi-post type for query block.
    • Native Interactivity API usage – so may not work with custom query block but works with WP core query.

    Multiple way to display filters

    • Dropdown
    • Radio
    • Checkbox
    • Multiselect

    Filter

    Filter can display taxonomies, post type, author and order filter.

    IMPORTANT: Block will automatically fetch available taxonomy and terms (frontend)based on the current query!

    Filter is a single interactive element which allows to build UI as you want.

    Taxonomies loads all taxonomies from currently selected post type in the query.

    The filters type:

    • Taxonomy
      • Dropdown
      • Radio (Vertical/horizontal)
      • Checkbox (Vertical/horizontal)
      • Native multiselect – to allow hook any favorite JS here.
    • Order
    • Author
    • Post Type – in case of multi-post type library extension usage.

    When added it asks to select filer which could be done in sidebar

    The filter in Radio/Checkbox mode can have mobile toggle filter – this is for hide/close the filter to not take too much space

    Editor:

    Basic frontend:

    Cehckbox

    Radio:

    Dropdown:

    Multiselect:

    Filters

    This block allows to add inner block:

    • Query Single filter
    • Query Clear filters
    • Query Chips
    • Query Search
    • Core filters count
    • Core paragraph
    • Core Heading

    The purpose is to allow grouping the filters to have one global collapse on mobile

    Chips

    Show currently applied filters

    Each element has class type of taxonomy/data-type so can be easy styled per taxonomy or type.

    Load more/Infinity load

    This block should not be used with pagination block! Remove it if exists!

    Adds load more functionality. Not there is no align settings for button – sorry 😀

    Infinity load has option for treshold load

    Search

    Custom search for query to make it work and don’t realy on standard search – intentionally to not create any side effects.

    Clear filters

    Adds button to clear filters -visible only when there are filters applied.


    Example usage


    The filters

    18 results found
    Order / Order By