Tagged: Shortcodes
-
AuthorPosts
-
June 2, 2016 at 7:11 am #641867
Hi there,
I am building a custom template and want to hardcode some shortcode functions into it like this
<?php $shortcode = "[av_blog blog_type='posts' categories='7' link='category' blog_style='blog-grid' columns='4' contents='excerpt' content_length='content' preview_mode='auto' image_size='portfolio' items='4' offset='0' paginate='no' conditional='' custom_class='']"; echo do_shortcode($shortcode); ?>
I havent been able to find a good reference for the available shortcodes, so I am building what I need in the Layout Builder and then copying the generated shortcode out of the database.
But is there are handy reference for the available shortcodes and their parameters?
The main one Im struggling with is `[av_masonry_entries]‘ I’m trying to pass it specific IDs but its not working:
<?php $shortcode = "[av_masonry_entries ids='166,195,185,186' link='portfolio_entries' sort='no' items='4' columns='4' paginate='no' query_orderby='title' query_order='DESC' size='flex' gap='large' overlay_fx='' id='wine-list' caption_elements='title excerpt' caption_styling='' caption_display='always' custom_class='wine-list']"; echo do_shortcode($shortcode); ?>
Which is the best masonry shortcode for a grid of specific posts please?
- This topic was modified 8 years, 5 months ago by Twisted Pear.
June 2, 2016 at 8:58 am #641909i do not know if this will work at all.
in avia-templatebuilder/avia-shortcodes folder there is the masonry.php and perhaps relevant for that too the helper-masonry.php
there you can see some more infomation about this shortcode.i’m not a good coder but maybe you see something could help you.
f.e. i see on helper-masonry that “ids” is set to false …June 2, 2016 at 9:10 am #641910Thanks Guenni007,
I have been searching through those files for clues – but its very slow going.
Cheers,
CJ
June 4, 2016 at 4:44 am #642813Hi,
Thank you for using Enfold.
I havent been able to find a good reference for the available shortcodes, so I am building what I need in the Layout Builder and then copying the generated shortcode out of the database.
Have you tried the shortcode generator in the default editor? You can also set the builder to debug mode so that you can see the actual shortcode below the builder: http://kriesi.at/documentation/enfold/enable-advanced-layout-builder-debug/
Best regards,
IsmaelJune 8, 2016 at 3:27 am #644469Thanks Ismael – that is a really helpful.
Last question, is there a ‘Blog Posts’ content element that accepts a list of specific IDs rather than a category ID?
I’m trying to display a custom list of featured posts.
Thanks,
CJ
June 8, 2016 at 2:37 pm #644847Hi,
You could try adding additional category to these posts you would like to display and choose their ID’s :)
Best regards,
YigitJune 9, 2016 at 4:14 am #645193Thanks guys,
I got it working by including an IDS shortcode attribute and then adding that to the WP_QUERY as a ‘post__in’ parameter (note: the double underscore).
Here are some relevant snippets:
$shortcode = "[av_blog blog_type='posts' ids='" . $id_list . "' ]"; echo do_shortcode($shortcode);
and for the shortcode handler:
…if(!empty($params['ids'])) { $posts = explode(',', $params['ids']); $query['post__in'] = $posts; $query['orderby'] = 'post__in'; } $this->entries = new WP_Query( $query );
Its working really well – thanks.
CJ
- This reply was modified 8 years, 5 months ago by Twisted Pear.
-
AuthorPosts
- The topic ‘Is there a guide/documentation for the available shortcodes?’ is closed to new replies.