• Resolved hasdf

    (@hasdf)


    Hello there,

    I would like an Events-Page with a series of events (title, image, short text, date, etc). Pretty much standard things.

    But above that Event-Page I’d like to have space for important blogposts. Is it somehow possible to show blogposts which are marked as “stick this post to front page” before the events list?

    If you don’t have a solution, can you please post some search-terms for me?

    Thank you!

    https://www.ads-software.com/plugins/events-manager/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter hasdf

    (@hasdf)

    Sorry for double-post – can’t edit the post anymore.

    Already tried to copy this to the top of ‘/twentyfifteen/plugins/events-manager/templates/events-list.php’:
    https://codex.www.ads-software.com/Sticky_Posts#Display_Sticky_Posts

    Didn’t show anything, but typing in just ‘test’ changed the events list.

    Thread Starter hasdf

    (@hasdf)

    Of course it did work… Well this might be the noobiest code in history of this support-forum, but it does what I want: Show the first sticky blog post.

    $sticky = get_option( 'sticky_posts' );
    $args = array(
    	'posts_per_page' => 1,
            'post__in'  => $sticky,
            'ignore_sticky_posts' => 1
    );
    $query = new WP_Query( $args );
    if ( isset($sticky[0]) ) {
            $queried_post = get_post($sticky[0]);
            $title = $queried_post->post_title;
            echo $title;
    	echo $queried_post->post_content;
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Events page with Sticky-Blog-post on top’ is closed to new replies.