Here is an idea:
- Use
get_posts()
to get posts you want. - On the right hand side show titles via
foreach
. - use
setup_postdata()
on right hand side loop to get post content. - You can use jquery tabs to show and hide post content or just use jquery.
- Don’t do
get_posts()
twice or use ajax because you already got contents when you didget_posts()
on no. 1
How do you relate contents:
So you have content of same posts on two part of the page. How do you relate them to use on jquery. Well, you can use post id off course. Check for same id on the content area if id matches with title show the content.
<h1 id="post_<?php the_ID(); ?>><?php the_title(); ?></h1>
...
...
<div id="post_content_<?php the_ID(); ?>>the_content();</div>
...
...
Related Posts:
- Loop doesn’t show title of second post and posts thereafter
- How can I remove the first two words and shorten get_the_title()
- How do I show the post title if an advanced custom field hasn’t been used?
- Print Current Post Index number within Loop
- rewind_posts() – what actually the use of it, and where using is required or preferred?
- How to show list of posts by author and category?
- Override the default number of posts to show for a single loop?
- Get title of post without using the_title();
- WordPress Number of Posts Not Changing With posts_per_page
- Find most recent authors
- Get the author of the latest revision
- Strange switch_to_blog() issue
- Multiple loops in same page, without duplicate content
- loop not displaying posts on custom template page
- How to Display Post View Count
- Displaying the number of posts in a custom loop (without including the number of posts of a loop below)?
- The correct way to call posts with ajax
- Converting multiple loops into one single loop with pagination
- How would I get 1 latest post from a query for 5 posts?
- Alternating post layout
- Check to see if specific loop has less than certain amount of posts
- I want to show category in the post title , how can I do
- Lose “Blog Archive” from page title
- Adding specific post category between posts in loop
- Multiple loops are not reset
- Exclude category from
- Blog post per page setting conflicting with custom WP_Query?
- How to exclude latest x posts from a paginated query?
- Pausing and Resuming WP_Query results
- Post Loop Missing Most Recent Post
- How to : pagination in 3 different custom loops on the same page
- Sharing post from archive page (loop) doesn’t work
- Start WP Pagination From Number 1 in URL
- sql select for post_title and a term name
- Use two different post_per_page limits with infinite scroll
- Wrong post title displayed from loop
- How To capitalize The First Letter Of Every Word In The Post Title
- Change all author links in Blog roll
- Showing categories and subcategories with posts
- Get the amount of posts on a current page
- older blog posts not showing in new theme
- How to get posts published on the latest date?
- Page and post loop same template
- WordPress Query Posts From Category Post on Static Page
- How to style archive post titles… but only those posts who have comments?
- Loop through posts? Want to remove extra newlines in actual post HTML/content on backend
- WP_Query: Show 10 posts in date order, first three random
- Change Post Title For Specific Category
- How include css class based on post ( in loop ) slug?
- WordPress Loop: How to display recent posts in multiple divs
- How to display posts on custom page without declaring a posts page in reading settings?
- Cannot implement byline into posts container in single.php
- Optimizing the blog loop
- How to check if there are posts with the same tag
- Custom WP_Query not working correctly
- WP_Query of Category Not Showing First Post
- How come this loop is not working? [closed]
- posts going to 2 pages/categories only show up in 1
- Using the loop to set locations for all posts on a single google map
- Separate top level categories on archive-product.php by meta
- While loop in functions.php outputting the_title() of each post on frontpage
- Shortcode for Comments and Comment Boxes in Post Loop
- Permalink Short code showing unnecessary link text inside the loop
- Post title not displaying as recorded in the wp_posts table
- Display specific posts based on an ID of another post
- How to distinguish pages created by woocommerce?
- long-title posts do not want published
- Moved a website and excerpts don’t work for old posts
- Please I want to prefix my WP posts title according to each category
- Post title spoiler how?
- Double loop output
- how to call recent post content in a loop ( only the content before read more tag)
- post->ID displays the same ID number for every post
- Posts are not showing up on next page.
- Can the_post_navigation() be outside of the loop?
- How to get all posts in gallery post format template
- Show Posts By Custom Field
- Hide title in Merlin Theme on posts and pages only
- Querying multiple categories in the WP loop if one of the category IDs is dynamically obtained
- Post are not showing up
- How to make post button to a random post
- Post gallery as carousel
- Showing content from WordPress ruins page CSS using WP_Query, without, content does not show
- Add something after all sticky posts in The Loop
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- Display Post by menu order
- Make assigning post to a specific category equivalent to assigning it to all categories
- How to get all post titles starting with numbers and symbols?
- How to inject a post within a loop
- Getting rid of the blog page entirely
- Custom Post Title as search term
- Loop not allowing infinite scroll after post per page limit
- Customise the appearance of 4 specific post ID’s within the loop?
- what template-part to call, to have my post in the center of the page?
- How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?
- Single post pagination
- How do I create a template page to show 3 blog posts?
- posts_per_page – Repeats only first posts ‘post__in’ array
- blog post displaying within older post – loop issue?
- How to link Post Title to uploaded file?