Tagged: 

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #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 4 years, 11 months ago by  Twisted Pear.
    #641909

    i 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 …

    #641910

    Thanks Guenni007,

    I have been searching through those files for clues – but its very slow going.

    Cheers,

    CJ

    #642813

    Hi,

    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,
    Ismael

    #644469

    Thanks 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

    #644847

    Hi,

    You could try adding additional category to these posts you would like to display and choose their ID’s :)

    Best regards,
    Yigit

    #645193

    Thanks 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 4 years, 11 months ago by  Twisted Pear.
Viewing 7 posts - 1 through 7 (of 7 total)

The topic ‘Is there a guide/documentation for the available shortcodes?’ is closed to new replies.