0

I'm trying to show the latest 5 entries in a channel, when a user views an entry within the channel.

At the moment, the code will only show the info for the single entry in both sections. My code is below;

<div class="grid">
    <div class="col-2-3">
{exp:channel:entries 
    channel="news" 
    require_entry="yes"
}
        <h1>{title}</h1>
        {body}
{/exp:channel:entries}
    </div>
    <div class="col-1-3">
        <h2>Top News</h2>
        <ul class="news-headlines">
{exp:channel:entries 
    channel="news" 
    orderby="entry_date" 
    sort="desc" 
    limit="5"
}
            <li class="item">
                <h3><a href="{url_title_path=" ee/news-article"}">{title} </a> </h3>
                <p>{excerpt}</p>
            </li>
{/exp:channel:entries}
        </ul>
    </div>
</div>

2

Add dynamic="no" to the channel entries tag.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.