You have a typo
$a = the_ID();
$data = $wpdb->get_results("SELECT `id`,`guid` FROM `wp_posts` WHERE `post_type` = 'local-offer' group by `post_author`");
$result = $wpdb->get_results("SELECT * FROM `wp_postmeta` WHERE `post_id` = ".$a." ");
Related Posts:
- Alter query on edit.php
- Automatically generate Post/Page from searched Database item?
- Build A Custom SQL Query for WordPress Search
- Transaction when using WP functions rather than vanilla SQL?
- How to auto login user again after change user_login
- Handling error states with admin_post
- count number of user comments with a specific comment meta value
- get_the_content if it contains multiple lines it results in SyntaxError
- Insert code when users come from an specific referer
- How to display related posts from parent category
- my function doesn’t return my post from today
- Make custom field meta not display if there is not data in it
- How to migrate the posts from an old custom legacy blog to a new WordPress website?
- Get_the_author doesn’t return author name
- How can I use wp_query to show all product data using just the products ID?
- Get Current User Id Inside a Loop Returns 0 For a Shortcode
- Get stock by custom meta field on all Woocommerce variable products
- Trying to add attribute to my posts’ featured image
- Transferring working local PHP site to wordpress – with database (MySQL)
- how to delete 30 day old data using PHP [closed]
- Display fields as values in array from external SQL DB
- Detect session/cookie variable in wordpress to prevent access to documents
- Loop through categories and display posts title under each dropdown
- WP_Query adds “(wp_posts.ID = ‘0’)” so no results are returned
- How to store post ID’s in cookie or session to display the same posts later
- Post + form + action + results on the same page
- Archive post by meta value + 24hours
- Post repeating with infinite scroll
- Display related posts without a plugin
- Count posts on multisite with blog id
- Making (and edit existing) posts with ID included
- Parsing Menu Items and Blog Posts
- $wpdb returns duplicate posts
- How to show an entire post content and not also the excerpt?
- WordPress query undefined offset in loop
- Use $wpdb or other PHP script method to find/replace in WP database
- WP_Query: getting posts where custom field exists
- Increment paged on WP_Query
- PHP -> SQL Query with Summing
- get post id from wp_insert_post for get_template_part
- Modify main query before it run without pre_get_post
- .html end of URl affected to SEO?
- Displaying content on posts page based on category
- how to make an array of post id’s in is_single
- Loading Posts & Category with Ajax
- array_rand not working correctly?
- Update if post with specific title exists
- WP_Query() load selected post
- Unable to render custom field after attempt to generate a list of recent post in page template
- Why when I create a new post I found 2 record related to this post into the posts database table?
- mySQL queries are executed twice on wordpress website
- Remove password protection from all posts
- wordpress sql posts query won’t display the latest post in a specific category
- Display latest post from WordPress Featured Category that is also in X,Y,or Z categories
- Woocommerce Custom Meta Boxes- How to only display if they actually have content
- understand what code is doing when prepending /blog
- Advanced Query posts
- My worpress search page is showing no results
- duplicate posts with ajax load more wordpress
- WordPress SQL Prepare
- My Custom Post Type AJAX Query is Returning no posts – why?
- How to display 8 posts in four columns and 2 rows on a carousel slide?
- Fetch Data from an external MSSQL Database in a Managed WP hosting
- Inside Array – “unidentified index” error with “prepare was called incorrectly” despite not calling the prepared statement with wordpress [closed]
- Time Stamp In A WordPress Post Title That Does Not Keep Refreshing
- Don’t update modified post date when user add a product review or comment?
- Limit the number of characters/words in an excerpt for a related posts section
- Show a text if the post has written by author user role in WordPress
- Getting info about selected posts using one WP_Query
- Closing Comments conditionally in comments.php
- Change upload URL by mime type
- Having trouble with customizing blog posts on the home page
- Related Posts: if there is no category use tags
- WordPress post insertion from PHP file
- How do if all posts has this category ID then do this
- Make sticky post with FacetWP
- Getting page / post URL on publish and / or update
- user update profile for custom code
- Front end/Database connection in WP
- How do I get the featured post to share on Social Media and show on Individual Post pages?
- Insert div after every three posts in home.php [duplicate]
- PHP tag in post content makes wordpress go crazy
- SQL Query Search page
- Unable to get Post Category Name and URL
- Dynamically Create Posts Via XML File
- Basic PHP question (displaying post title over thumbnail) [closed]
- insert thumbnail image from php script
- Post from front end form to post_meta
- media_handle_sideload() returned post_id being incremented
- Saving Post redirects to 404 page when php $_GET variable in post body
- How can I add WordPress Audio Player as featured audio in Audio Blog Posts?
- Trying to see if page is category or single and displaying title with appropriate heading tag
- How to export database correctly for local to online
- How to customize posts in WordPress by using HTML and CSS?
- foreach all the post
- Blog Posts not sorted and pagination not adjusted after filtering some category
- Add multiple HTML attributes to an Elementor button
- How to use a conditional statement in a post loop but not count towards the “posts_per_page” if false
- SQL query to retrieve the number of WordPress posts with all given categories
- Bulk data save in custom table