-
Author
-
August 26, 2015 at 04:25 #74660
jonbrowne
ParticipantI have been trying to add a visual composer short code to “posts” via editor. However, it does not work. I have tried several ad unit plugins but, they conflict with cache plugins.
I would like to add “Kleo Posts” to the bottom of every article.
How can I accomplish this?
Thank you!
August 27, 2015 at 16:21 #74855Radu
ModeratorHi,
I’ve made a little function that helps you to achieve this.
Just replace the shortcode ( [vc_posts_grid loop="size:10|order_by:date|post_type:post"] ) with your desired shortcode.
$shortcode = ‘[vc_posts_grid loop="size:10|order_by:date|post_type:post"]‘;
COPY CODEfunction CustomKleoAddContentAfterPost( $content ) { if( is_single() ) { $shortcode = '[vc_posts_grid loop="size:10|order_by:date|post_type:post"]'; $content .= '<h4>Kleo Posts Grid</h4>'; $content .= do_shortcode($shortcode); } return $content; } add_filter('the_content', 'CustomKleoAddContentAfterPost');You need to put this snippet to your kleo-child/functions.php
Best Regards
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionAugust 28, 2015 at 04:31 #75010jonbrowne
ParticipantThank you. But, I tried implementing this but, the suggested posts do not appear.
I would like for an ad unit to appear to the left of the 3 suggested Kleo posts.
This is the code I added. But, it still does not work.
[vc_row][vc_column width="1/2"][vc_column_text]AD UNIT CODE[/vc_column_text][/vc_column][vc_column width="1/2"][vc_posts_grid loop="size:3|order_by:date|post_type:post|categories:3" post_layout="small" show_meta="no" show_excerpt="no" show_footer="no"][/vc_column][/vc_row]
Do you have any other suggestions?
August 28, 2015 at 20:07 #75088Radu
ModeratorYou need to put only the short code
[vc_posts_grid loop="size:3|order_by:date|post_type:post|categories:3" post_layout="small" show_meta="no" show_excerpt="no" show_footer="no"]
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.