Reusable Custom Blocks

Embed video on a post and display it on a single post and a page.

Display on a Single Post <?php /* Video Embed */ ?> <div class=”embed-container”> <?php the_field(‘video’); ?> </div> Display on a Page <?php /** ** Custom Post Video **/ ?> <style> .wp-block-lazyblock-custom-post-video{ display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; position:relative; } .team_all_box{ background: #F5F5FF; border-radius:5px; } /* PAGINATION */ .pagination{ position:absolute; bottom:-3em; text-align:center; width:100%; } […]

PHP Code Snippets/Functions Reusable Custom Blocks

How to make a custom patterns?

register_block_pattern( string $pattern_name, array $pattern_properties ) This is how to registered a custom block pattern. Copy and paste the code above, to functions.php The ‘content’ is where we can put or write the design layout of the pattern, this is how to get code on the page editor. see the screenshot below.

PHP Code Snippets/Functions

How to display all the child of the parent page

Parameter: ‘child_of’ – (int) Page ID to return child and grandchild pages of. ‘exclude’ – (int[]) Array of page IDs to exclude. ‘sort_column’ – (string) What columns to sort pages by, comma-separated. ‘sort_order’ – (string) How to sort retrieved pages. Accepts ‘ASC’, ‘DESC’. For more information about the get_pages function, you can visit here. $args = array( ‘exclude’ => […]

Reusable Custom Blocks

Custom Taxonomy Block

A dyanmic block that outputs custom taxonomy of a custom post type. REQUIRED LAZYBLOCK FIELDS:font-size = NUMBERfont-color = COLOR PICKERtext-transform = SELECT/TEXTletter-spacing = NUMBER <?php /** * Template for Auction Type [Taxonomy] */ global $post; $font_size = $attributes[‘font-size’]; $font_color = $attributes[‘font-color’]; $text_transform = $attributes[‘text-transform’]; $letter_spacing = $attributes[‘letter-spacing’]; $auction_type = get_object_term_cache( $post->ID, ‘auction-types’ ); ?> <style> […]

Reusable Custom Blocks

Custom Post Type Slider

A block that queries and outputs custom post types in a slider using slickslider. REQUIRED LIBRARIES (insert these in enqueuing styles and scripts in functions.php):wp_enqueue_script( ‘slick-js’, ‘https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/slick.min.js’);wp_enqueue_style( ‘slick-css’, ‘https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/slick.min.css’ ); REQUIRED LAZYBLOCK FIELDS:slide-count = NUMBERbutton-text = TEXTtitle-color = COLOR PICKERtitle-size = NUMBER Still looking for solutions on how to make slickslider work in wp backend. […]