Hi Lewis!
Welcome back ??
The best way to include WP Tiles in a php template, is by using the_wp_tiles()
. I haven’t documented this for the new version yet, but this week I have set some time apart to finish the docs for the 1.0 version and finally release it in full. When the release happens, it will all be on https://wp-tiles.com/.
But the way you’re doing it now is valid, and if it works it works!
For exclude_current_post
, however, the shortcode should be in the loop. In most templates that is between if ( have_posts() ) : while ( have_posts() ) : the_post();
and endwhile; else :
.
But because you are putting the shortcode in a template file directly, you could exclude the current post yourself manually, also outside the loop. To do this, add exclude=' . get_the_ID() . '
to the shortcode. It would then look like this:
<?php echo do_shortcode('[wp-tiles post_type="Portfolio" orderby="date" order="ASC" grids="Portfolio" small_screen_grid="Mobile" breakpoint="800" padding="25" grid_selector_color="#444444" posts_per_page=4 exclude=' . get_the_ID() . ']'); ?>
(Oh btw, there seems to be a </div>
too many in your example, after the shortcode!)
Let me know if that worked for you!
Mike