WordPress.org

Ready to get started?Download WordPress

Forums

Posts 2 Posts
Pagination for connected posts on single post template (1 post)

  1. blogjunkie
    Member
    Posted 1 year ago #

    I'm using Posts 2 Posts with The Events Calendar plugin. I've made a connection for events and posts. This way the site can display the Event details and blog posts about the upcoming event under it.

    I modified single-event.php to show the Event details and connected posts below it. I want to paginate the posts. I have this code to show related posts on my event:

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    $connected = new WP_Query( array(
      'connected_type' => 'posts_to_events',
      'connected_items' => get_queried_object(),
      'posts_per_page' => 5,
      'paged' => get_query_var( 'paged' ),
    ) );

    Going to http://localhost/event/event-name/page/2 redirects me back to http://localhost/event/event-name/ so I can't see more than the most recent connected posts.

    I know the single post template is only meant to show the current post, so I'm not sure what I should do. Hope someone can give me a clue. Thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic