Not Showing on Front End?

Support MB Blocks Not Showing on Front End?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #44462
    Andrew TegenkampAndrew Tegenkamp
    Participant

    I have an MB Block and the template file to display the block is not showing on the front end. Do I need to do anything with my theme? The template.php in render_template is showing on the back end (in Gutenberg).

    
    add_filter( 'rwmb_meta_boxes', function( $meta_boxes ) {
    	$meta_boxes[] = [
    		'title' => 'My Post Picker',
    		'id'    => 'my-post-picker',
    		'type'  => 'block', // Important.
    		'icon'  => 'admin-post', // Or you can set a custom SVG if you don't like Dashicons
    		'category' => 'text',
    		//'mode' => 'edit', //The default mode of the block: edit to make it shows the edit fields when loaded, preview (default) to show the rendered HTML when loaded.
    		'context' => 'side', // The block settings will be available on the right sidebar.
    		'render_template' => get_stylesheet_directory() . '/blocks/template.php', // The PHP template that renders the block.
    		// Now register the block fields.
    		'fields' => [
    			[
    				'id'   => 'vpp_post',
    				'type' => 'post',
    				'name' => 'Link:',
    				'post_type' => ['post','page','attachment'],
    				'field_type'  => 'select_advanced',
    				'query_args'  => [
    					'post_status'    => ['any'],
    					'posts_per_page' => - 1,
    				],
    			],
    		],
    	];
    	return $meta_boxes;
    });
    
    #44466
    PeterPeter
    Moderator

    Hello Andrew,

    If the block content shows the admin area, it should show in the frontend properly. You can try to deactivate all plugins except Meta Box, MB extension plugins, switch to a standard theme of WordPress and check this issue gain.

    If it persists, please share the template.php file content here, I will help you to check the issue.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.