WordPress.org

Ready to get started?Download WordPress

Forums

Wp Custom CMS Block
[resolved] Single Post (2 posts)

  1. kamil1111
    Member
    Posted 1 year ago #

    Hi,
    how can I enable custom blocks in a single.php?

    <?php the_field('name'); ?>

    it's not working now.

    Thanks.

    http://wordpress.org/extend/plugins/wp-custom-cms-block/

  2. Digonto Ahsan
    Member
    Plugin Author

    Posted 1 year ago #

    You can use shortcode in page or post editor as content. Also you can use shortcode in single.php or in any template file like -
    <?php echo do_shortcode('[block id="1"]');?>
    You can use php function get_wpcc_blocks() to get all blocks in an associate array.

    <?php
    	$allblocks = get_wpcc_blocks();
    	echo $allblocks['blockone'];
    ?>

    Here 'blockone' is block id.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.