it does not give the entire post but it will give a random post list entry
This is in normal xtgem blog markup where the standard xtblog.twig has been renamed blog.twig
{% if data.translations.t_no_entries_found == 'random' and view == 'entries_list'%}
{% set entry=data.entries[random(data.entries|length-1)]%}
<div>
<a class="xt_blog_title_link" href="{{ entry.url }}">
<span class="xt_heading">{{ entry.title }}{% if data.entry_list_show_time %} <span class="xt_blog_entry_time">{{entry.created}}</span>{% endif %}</span>
{% if entry.comments_count %}
<span class="xt_blog_comments_number">( {{ entry.comments_count }} )</span>
{% endif %}
</a>
{% if data.display_type != 'header' and entry.content %}
<span class="xt_description">{{ entry.content|raw }}</span>
{% endif %}
</div>
{%else%}
{%include 'blog.twig'%}
{%endif%}
Copy code
You then need a blog function with entries_per_page="0" and t_no_entries_found="random"{% set entry=data.entries[random(data.entries|length-1)]%}
<div>
<a class="xt_blog_title_link" href="{{ entry.url }}">
<span class="xt_heading">{{ entry.title }}{% if data.entry_list_show_time %} <span class="xt_blog_entry_time">{{entry.created}}</span>{% endif %}</span>
{% if entry.comments_count %}
<span class="xt_blog_comments_number">( {{ entry.comments_count }} )</span>
{% endif %}
</a>
{% if data.display_type != 'header' and entry.content %}
<span class="xt_description">{{ entry.content|raw }}</span>
{% endif %}
</div>
{%else%}
{%include 'blog.twig'%}
{%endif%}
Copy code
Remember that this can mess up the blog block id if you have other blog functions on the page so you may also need to allow for that