The way you are thinking wordpress is, is not like that. You can’t find the query and alter it like you do in plain PHP. There are filters and actions and a whole architecture to play with pages and posts. I suggest you to read wordpress documentation and Codex.
If you are a programmer then have understanding with PHP and little bit of database then you will be amazed to see the architecture of wordpress.
Suggested Reading:
Related Posts:
- Why won’t pagination work?
- WordPress Query Posts From Category Post on Static Page
- How to create a page that shows the last 10 posts?
- Export all posts to import as product items
- Direct some posts to only appear on a specific page
- Prevent duplicate pages from being added
- Separate blog and reviews categories
- Create a List of Widgets, where each widget holds three attributes
- Change published date and time using SQL query for page in every 5 hour
- WordPress empty page! what is wrong with this code?
- Bulk find & replace on WordPress posts/pages (minus image paths)
- Count posts for pagination
- Multiple Pages – Seperate blogs
- How to run select query of post with category and tags?
- Special Query: Title, Terms, Content – %LIKE%
- Need to show birthday of custom post type(Famous people in this case) in elementor. Date of birth set in custom fields
- Change permalinks in posts via SQL
- Batch Scanning and Deleting Empty WordPress Posts
- How to create a “latest news” page showing a list of posts from blog category
- How do you search for a post or page with a certain url on the WordPress admin panel?
- Very complex post query
- How to add some html formated text to every new post in WordPress
- Delete post revisions only for a single post
- How to Assign / Move all Deleted post to a category
- Intercept page request and add value to it
- Migrate posts from category and sub-category via SQL
- How to give classname to post if post has no content?
- Display post by click on the link
- WordPress 302 Redirect to Random Product/Post/Page
- Output Post with ACF Fields into other Post
- $_GET parametters not working in an specific template
- Queries take 120+ seconds on my large WordPress site
- Exclude some posts from displaying in wp_query based on some condition
- New Posts and Pages Won’t Save
- My Custom Post Type Still Using index.php
- get_children returns older images
- Posts and Pages: 404 Page not found
- How to get the latest URL of my blog?
- Related Posts function not working
- How to retrieve certain number of images from a wordpress post?
- the_content() Not Grabbing All Content
- Un-highlight Blog Menu Item when Category Menu Item is Selected
- Display Featured Posts Grid on Static Page (Gazette)
- Detecting current page from class method
- Having pages after specifying post_type post
- Unabled to Change Permalinks – Even Using the “Edit” (Resets to Original Permalink on “Update”)
- List all posts, pages and custom post types in admin
- How to convert query sql to shortcode in wordpress?
- WordPress loop not working on static front page
- Exclude post category in a blog page
- Make ‘blog’ page show content as well as posts underneath it
- I don’t want the complete article to show on homepage
- How to set a certain Custom Template to a Single Blog Post
- Post/page title to permalink transformation – what is behind the scenes?
- Change Author Name to Sitename on Frontend
- Would a “hub” page work better as a page or a post?
- Some doubts about how the loop work (trying debugging it)
- Display on page every post in blog WITH comments
- Are post, page and category IDs unique to each other?
- Showing recent post of category in page
- HTML Inside of Shortcode Breaks Shortcode Output
- Sidebar on single.php not showing up
- Where is the “Posts”/”Blog” template?
- Setting limit to posts or page creation
- SQL Bulk Move old posts by one author to another category
- How to display only one category in a custom post type?
- Create a frontpage.php and static page template
- Using Posts Like a Page
- Pagination for normal (standard) posts on a page with a custom loop?
- Changing wp_link_pages() to “Next Page” and “Previous Page” buttons?
- posts going to 2 pages/categories only show up in 1
- Have posts included on a page that share same category
- Preview page/post revisions without overwriting current content
- Adjust the order for returned posts
- Link from Post to Another Post Via Clicking on Words within Original Post
- get last post’s link with SQL query
- How to separate each individual blog post?
- Page of posts made to look like homepage
- post/page content
- Link to older links
- How to link post titles on page A to its posts on page B?
- WordPress Architecture as a CMS – Posts & Pages
- Is it to possible to insert a page in the post depending on the category ofthe post
- Organization of time insensitive content
- Trim posts from WP-Query?
- How can I get posts from 9/13/11 to today with SQL? [closed]
- Adding if statement into the_content()
- How can I add a page that shows posts from a single category?
- How to show next/prev link, when it’s not active?
- Custom Select Query – Selecting the Year?
- Archieve page, Advertisement Every 3 Posts
- Anyone know a php snippet for showing the first 200 characters of the most recent post?
- Prevent 404 of Author pages without posts
- Get current taxonomy and display query accordingly
- Show 10 latest posts only from users with contributors role
- Trying to exclude custom posts based on date, while sorting by custom field
- Different post views for different category views
- WordPress, custom post type and posts query help!
- How Can I Always Display A Particular Post First Using WP_Query?
- What would causes search to return incorrect results?