Select WordPress posts query with categories wise use core php

WordPress 0 Comments
wordpress-code

If we are used the wordpress blog and than display the wordpress title name and other content in php page so  fetch the data from MYSQL database used the core php

write and discuss about the select the post title in mysql used the core php

Category Wise Select Title Name

Daily Visit GK on myshort.in

Slug name Show in the query  ( AND t.slug = ‘result’ )  in Category  option (Show in  bottom of Category Name )  in wp-admin

$sqls=”SELECT *
FROM wp_posts p
LEFT OUTER JOIN wp_term_relationships r ON r.object_id = p.ID
LEFT OUTER JOIN wp_term_taxonomy x ON x.term_taxonomy_id = r.term_taxonomy_id
LEFT OUTER JOIN wp_terms t ON t.term_id = x.term_id
WHERE p.post_status = ‘publish’
AND p.post_type = ‘post’
AND t.slug = ‘result’
ORDER BY ID DESC LIMIT 14″;

 

 

$sqls= “SELECT DISTINCT wp_posts.* FROM wp_posts
LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)
LEFT JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id)
WHERE wp_posts.post_status = ‘publish’
AND wp_term_taxonomy.taxonomy = ‘category’
AND wp_term_taxonomy.term_id IN (1033)
ORDER BY post_date DESC
LIMIT 5″;

 

$sqls=”SELECT DISTINCT
post_title FROM wp_posts p
LEFT OUTER JOIN wp_term_relationships r ON r.object_id = p.ID
LEFT OUTER JOIN wp_term_taxonomy x ON x.term_taxonomy_id = r.term_taxonomy_id
LEFT OUTER JOIN wp_terms t ON t.term_id = x.term_id
WHERE p.post_status = ‘publish’
AND wp_term_taxonomy.taxonomy = ‘category’
AND p.post_type = ‘post’ ORDER BY ID DESC LIMIT 16″;

 

$sqls=”SELECT DISTINCT
post_title FROM wp_posts p
LEFT OUTER JOIN wp_term_relationships r ON r.object_id = p.ID
LEFT OUTER JOIN wp_term_taxonomy x ON x.term_taxonomy_id = r.term_taxonomy_id
LEFT OUTER JOIN wp_terms t ON t.term_id = x.term_id
WHERE p.post_status = ‘publish’
AND p.post_type = ‘post’ ORDER BY ID DESC LIMIT 7”;

 

 

Buy online Rajasthan gk book Railway JE CBT REET PAtwari Book SSC CGL Clerk GD Book Buy online Rajasthan gk book Railway JE CBT REET PAtwari Book SSC CGL Clerk GD Book

Best Book for Railway vacancies: 130000 Job Non-Technical CBT Question Bank competition all Exam: Rajasthan gk book Railway JE CBT REET PAtwari Book SSC CGL Clerk GD Book Buy online Rajasthan gk book Railway JE CBT REET PAtwari Book SSC CGL Clerk GD Book

Best Book for Railway vacancies: 130000 Job Non-Technical CBT Question Bank competition all Exam:

https://amzn.to/2CfZxnu

General Science GK in Hindi and English Samanya Vigyan for Bhartiya Railways RRB

https://amzn.to/2UAZABs

https://amzn.to/2TyikFe

General Science in English for RRB Junior Engineer, NTPC, ALP & Group D Exams

https://amzn.to/2CibCIN

Best Book for Rajasthan Police LDC Patwar RAS Level and Rajasthan competition all Exam:

Rajasthan History Rajasthan ka itihas Kala Sanskriti Best Book

https://amzn.to/2F8EKnC

https://amzn.to/2XTvniO

Rajasthan Economy Best Book for all competition Exam:

https://amzn.to/2XTLAVj

Rajasthan Geography Best book for all competition Exam:

https://amzn.to/2CkWgmS

Indian political, economics, geography Best Book for IAS RAS 1st 3nd 3rd grade teacher and all exam all Exam in hindi and english

Indian political book: https://amzn.to/2T2Ckuf

Indian political book: https://amzn.to/2CeJTbO

Indian economics book: https://amzn.to/2NYYBIy

Indian history book english: https://amzn.to/2T5uK1X

Indian history book hindi: https://amzn.to/2Ciwhw2

Ecology and Environment book: https://amzn.to/2ESjdOs

World geography book Best Book for IAS RAS 1st 3nd 3rd grade teacher and all exam all Exam in hindi and english

World geography book: https://amzn.to/2CcGMBh

world history: https://amzn.to/2T2wQQg

Best book for Indian history in hindi by Krishna Reddy (Author) and world history

share..Share on Facebook0Share on Google+0Tweet about this on TwitterShare on LinkedIn0