* Graham * filmbokep To show a random post you need to add a blog function with the entries_per_page="500" or more so that there is NO pagination and the script can select a random entry from the whole list it will show a random post every time getting it to just change every hour could require a lot more code (if it is even possible)
Then in the twig file you can test for no paging to output the random post or show a normal blog if entries_per_page < than the total number of posts
The twig code for the entries list could look something like this
{% block entries_list %}
            <div class="xt_blog_post_list">
{% if data.pagination_html|length %}
{% for entry in data.entries %}
                    <div class="xt_item">
                        <span>
                            <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 %}
                                <span class="arrow"></span>
                            </a>
                            {% if data.display_type != 'header' and entry.content %}
                                <span class="xt_description">{{ entry.content|raw }}</span>
                            {% endif %}
                        </span>
                    </div>
                {% endfor %}
{%else%}
                {%set entry=data.entries[(random(data.entries|length-1))] %}
                    <div class="xt_item">
                        <span>
                            <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 %}
                                <span class="arrow"></span>
                            </a>
                            {% if data.display_type != 'header' and entry.content %}
                                <span class="xt_description">{{ entry.content|raw }}</span>
                            {% endif %}
                        </span>
                    </div>
{%endif%}
                
            </div>
        {% endblock %}

Copy code

You can add the extra blog function for the random post above your normal one so it shows a random post and then the full list the second blog is shown with __xtblog_block_id=2 (now you know what that variable is for)
Here is a demo of the principle
http://blogtwig.xtgem.com/blag
2016-02-25 12:45 (edited 2016-02-25 13:13 by Graham ) · (0)

Online: Guests: 1