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
- Should we trust the post globals?
- How to change the case of all post titles to “Title Case”
- How to get posts published between a date and today?
- Apply the_title() filter in post & page title, but not in menu title
- How set featured posts using checkbox in post edit screen?
- Get first post from wp_query
- Do we still need to include a “if (have_posts())” in templates?
- Remove post title input from edit page
- WP_Query: Why is sticky post not first item in loop?
- Query *only* sticky posts
- Display all posts from specific categories on a page
- rewind_posts() – what actually the use of it, and where using is required or preferred?
- Skip post in loop and mixin later
- How to show list of posts by author and category?
- Set Post Title to Read-only and Disable Permalink Slug Editor in Gutenberg
- Override the default number of posts to show for a single loop?
- get comments and get posts in loop
- Disallow Same Post Title
- Get title of post without using the_title();
- Verify if tag is used on posts
- How do I reorder (pop and push) items from WP_Query?
- How to exclude latest x posts from a paginated query?
- Display content from a specific category
- Dynamically update post title in admin page
- Reverse chronology of post listing
- Why do I need to use The Loop on pages (inside page.php etc)?
- posts page – different lengths of excerpt
- WordPress Number of Posts Not Changing With posts_per_page
- how to display full post with pagination on home page
- Count singular post views automatically
- Looping through posts per category gives same posts for each category
- How to show posts rank based on custom field value
- Find most recent authors
- This AJAX Code Doesn’t Work – Looking for elegant solution
- Display All Sticky Post Before Regular Post
- Cannot access current post’s ID in custom plugin
- Can’t show comments count per post outside loop
- Get the author of the latest revision
- How to have different content in the loop and single
- Specific loop in Shortcode
- Strange switch_to_blog() issue
- Show a list of recently viewed posts to a user
- Multiple loops in same page, without duplicate content
- loop not displaying posts on custom template page
- Repost post on specific date every year
- How to use alternate post layout at key points in post loop?
- Alternate custom content in the loop
- Showing random content / pictures from earlier posts in a sticky post?
- Search widget breaks when using multiple loops?
- Displaying Page Title on index.php
- 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)?
- How to intercept Post Title on Post-Save
- Testing for post title in ‘if/else’ statement returns no content
- Display Latest Post from all Categories
- get_post_field – Title without paragraph
- Auto Refresh Post List after X seconds
- The correct way to call posts with ajax
- Add Category name to Post Title (h1)
- How to add a custom field after wp post
- custom wordpress post loop – hide iframe content
- Double count view in archive.php
- Sorting posts alphabetical that have single digits
- Divide Loop Into Days & Categories
- Converting multiple loops into one single loop with pagination
- Display posts with comments closed, with pagination?
- Group posts by year in loop
- How Can i Get 5 Recent Post Title With Corresponding Link?
- How would I get 1 latest post from a query for 5 posts?
- While in “the loop”, detect if a post is the most recent
- Alternating post layout
- Check to see if specific loop has less than certain amount of posts
- Different style for most recent article
- Contact form 7 post loop [closed]
- Differentiate between posts and pages in search results
- I want to show category in the post title , how can I do
- Related posts loop based on tags AND categories doesn’t work without at least one tag assigned
- Loop through all product posts?
- How to prevent WordPress from updating the modified time?
- How to display different number of posts
- If Specific Post, Link Elsewhere
- How to display following posts titles in separate div’s on a separate webpage
- How to filter posts that belong to a specific category only if that is the only category
- WP Query – duplicated posts once including tags in search results
- Most recent post from another database
- wp_tag_cloud() and the_taxonomies() work but not the_tag()
- Blog Posts not showing title
- Lose “Blog Archive” from page title
- get_next_post() and get_previous_post() return wrong posts
- Show all posts in sidebar in single.php
- Split WordPress Latest Posts in Multiple Columns and Rows with one single loop [closed]
- Avoid duplicate post from same Taxonomy
- Converting a dynamic piece of code using WordPress Loop into a static one using Post ID
- Display post from current category and same tag?
- How to Orderby Comments by post title?
- Alternate row and columns every X posts