One option could be to use data attributes on the entires listed on pages one and two. Then attach a click event that reads the attribute value on click saves it to localStorage. This way you wouldn’t need to make an extra db call on page three.
In the loop the data attribute value can come basically from anywhere. E.g. post meta, some post field, taxonomy or taxonomy term.
<?php while (have_posts()) : the_post(); ?>
<article class="entry" data-my-attribute="save-me-to-localstorage-onclick">
<!-- gallery image -->
<a><!-- link to next page/view --></a>
</article>
<?php endwhile; ?>
Related Posts:
- Redirect to another page using contact form 7? [closed]
- How do I “get the next 10 posts after post_id == x”?
- How to delete all trashed item in one-go
- WordPress hide post from custom post-type on a single page
- Trending Tags based on post views
- Insert data in custom table during new post creation
- WP_query parameters for date range
- How Do I Use The WordPress Plugin Posts 2 Posts by Scribu?
- Can we completely remove the WordPress Sitemaps (WordPress 5.5)?
- How To Ignore a Filter On Applying Filter the Content In a Function
- Thumb rating for wordpress – top user
- How to extract images of post and pages excluding header and logo image in wordpress?
- Seriously stuck with some custom meta box/plugin stuff
- Enable comments for post with comments meta box removed
- Custom Post Type causes Page Not Found
- Is it possible to filter the wp_footer() scripts, read the content, and insert them inline?
- post expire after x days
- How to get images from EDD post?
- How use %like% in sql statement wordpress
- WP_Query is printing out only one post when posts_per_page is set to multiple
- Can’t get order_by meta_value_num to work properly
- Is there a way to order posts and custom post types as one group?
- How can i list random post from multiple category?
- how do i remove posts from a WP_Query so the pagination is right?
- If post has custom field then display css-class
- get_post_type on post.php
- Matching Chapters to a Custom posts [closed]
- Creating a custom post type, adding custom meta fields, preventing all future editability of posts of this type
- Preg Match All doesn’t Allow echo first character for WordPress Taxonomy Tags
- How to call WordPress function other files
- External RSS feed to WordPress Portfolio
- ACF: post query, hide duplicate values [closed]
- pagination on data fetched using SQL query
- Custom setup of wordpress comments that are displayed
- WordPress custom taxonomy not showing
- How to Loop Through all Posts and Count Attachments using Get Media Attachments
- Allowing users to Sign-up > Login > Post articles that need approval
- Return multiple values in a shortcode attribute
- posts from multiple post types in one slider
- Creating an admin meta box to save post as pending
- Show related posts based of current ACF field name in a single page post (a loop within loop)
- 2 wordpress site same database
- Custom Template for wordpress cpt plugin
- “Allowed memory size” problem [closed]
- Get data from wp_posts of mysql in to variables of wordpress-php script
- What hook can I use to modify custom post data before it is displayed on the page?
- Delete data from custom table when deleting a post
- WordPress Stats Plugin: Display Post Views [closed]
- Pagination not working
- WP Insert Post If user refreshes override new post
- How to create repeater field manually, without plugin (ACF Pro)?
- Searching a tab/space delimited text file based upon form criteria and returning a ‘record’ into a word press results page
- Woo-commerce Update price as a Bulk from My offline software export
- Is it possible to pin a post in second position from top
- How to search post titles with whole words only, but not the exact word only?
- How to get the custom field value using SQL query
- how to display recent post by category on home page
- WordPress is redirecting me to homepage
- Is there a hook similar to “save_post” which only fires AFTER the post is completely published?
- Adding custom post category to categories widget
- How to display the custom post related blog by category?
- How to arrange custom posts in the backend/admin by custom taxonomy
- Problem with checked box on wp car manager plugin
- adding dynamic/multiple slug values in ‘option_none_value’
- How to get a specific string from a url
- How can I see $post object in frontend from functions.php?
- Is it possible to customize a wordpress post from outside dashboard(Something like site.com/post-type/post/?e=post_id)?
- wp_post_delete is deleting all offices
- Prefix WordPress Taxonomy Tags With Hashtag Symbol Like Twitter
- Failed to load resource: the server responded with a status of 500 () post.php
- How to echo a PHP Code After the Content
- Custom Post By Category
- How to get the posts that my following users are liked?
- Displaying friend’s posts only
- Loop carousel slider in wordpress
- Calling an custom field from theme option at the frontend
- WordPress list child pages of custom post type
- Ger posts from similar tags and categories
- WordPress ultra slow if I click on posts?
- Enforce conditions only for draft posts using WyPiekacz, ignore pending and published posts
- Making a Custom Post Type Publish Loop
- WordPress User Frontend Editing Custom Fields
- PHP $_session is not work in wordpress
- How to hide home title on pages and posts?
- Redirect a specific User role not admins automatically to view the post that they just updated
- How to export post tags from wordpress
- public custom posts not showing in my wordpress plugin
- Accessing Correct Database to Create REST API Endpoint
- Display comments of users on single page
- Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu
- Set Post Format if find a string in title or post content
- What is the best way for showing a grid of customer logos?
- Using ‘mysqli_connect’ ‘crashes’ WordPress client-side
- Remove a div class with condition
- PHP Error message Upload images to remote server
- No route was found matching the URL and request method
- CMB2 Output Select Box Chosen Option
- How to add jquery to my custom post type wp plugin
- What can I do to customize a widget provided with this plugin? from where have I to start?
- Attachement title in wpallimport