Email Blocks: Posts

Block Settings

Layout

  • Layout (Cards, Numbered List, Unordered List, H1, H2, H3, H4, H5)
  • Featured (On/Off)
    Displays a large single-column post above other posts. 
  • Excerpt  (On/Off)
    Display the excerpt
  • Thumbnail  (On/Off)
    Display thumbnail
  • Gap (Default: 20px)
    Adjust the gap between posts

Card Style

Content Padding

  • Based on pixels you can link/unlink the setting

Background Color

  • Color(Color picker with the global colors)

Border

  • Style(None, Solid, Dashed, Dotted, Double, Ridge, Groove, Inset, Outset - Default: None)
  • Color(Color picker with the global colors)
  • Width(based on pixels and you can link/unlink the setting)
  • Radius(based on pixels and you can link/unlink the setting)

Heading

  • Font(The globe gives you access to the global type settings, and the pencil edits specific Font Family, Font Size, Line Height, Font Weight, Font Style, and Transform)
  • Color(Color picker with the global colors)

Excerpt

  • Font(The globe gives you access to the global type settings, and the pencil edits specific Font Family, Font Size, Line Height, Font Weight, Font Style, and Transform)
  • Color(Color picker with the global colors)
  • Thumbnail

  • Thumbnail Size(Thumbnail, Medium, Large, and any additional sizes created by a theme or plugin)

Query

  • Post Type
  • Number of Posts
  • Offset
  • Categories
  • Tags
  • Include these posts
  • Exclude these posts
  • Query ID
To use the Query add "my_query" in the Query ID field. Below is an example of code to use in your Code Snippets plugin or the theme's functions.php file. 

<?php 
add_action( 'groundhogg/posts/wp_query/my_query', 'filter_email_post_query', 10, 3 );

/**
* You can set additional query parameters here
* @param $query WP_Query
* @param $query_vars array original query vars
* @param $contact \Groundhogg\Contact the contact
*/ 
function filter_email_post_query( &$query, $query_vars, $contact ) {    
    $query->set( 'tag__in', [ 1, 2, 3] ); 
}

More details: https://developer.wordpress.org/reference/classes/wp_query/

Note: The Posts Block does not currently support custom post types. But you can use the Post Replacement Code to generate posts from a custom post type. 

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us