Add Block 12 to single posts

Posted in: Newspaper
Post count: 31

I would like to display “Block 12” at the bottom of each single post page. I have a child theme and have customized the single post template. Is there a way to add Block 12 at the bottom of the post? Also, I would like it to only list posts within the category of the current post.

Thanks,
Rachel

Post count: 22421

Hi Rachel,
You can add a block to the post files using a do_shortcode function like so:
<?php echo do_shortcode('[vc_row][vc_column][td_block_12][/vc_column][/vc_row]'); ?>
You can add this code to the post template you use:
http://screencast.com/t/pXGvKb7aZ
The tricky part will be to make them detect the category of the post. The blocks were not created to detect anything so this feature will have to be created from scratch. You will need to hire a developer for it as there is no easy solution.
Thank you!

Post count: 31

Thanks, that shortcode works great. I don’t necessarily need it to detect the category, as long as I can filter by category. If it can be filtered, I could manage with an if/else statement for all of the categories. Is there a way to have it filter by category?

Thanks,
Rachel

Post count: 31

I guess I can see how to filter by category in the visual composer, but how do I access what the shortcode would be?
Thanks.

Post count: 22421

You can see the shortcode to any block in classic mode and text mode. That is how I got the one I showed above.
Simply create the block you want with the filters and all settings in place and then access the classic mode like so: http://screencast.com/t/aIiq2BNIW
Thanks.

Post count: 31

I think I got it.

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.