2.4k questions

2.4k answers

99.5k users

Categories

0 votes
83 views

How do I show MySQL query results on WordPress theme pages (without using a plug-in)?
in WordPress by (95.8k points)

1 Answer

0 votes

you may use (if you direct call the DB) WordPress and the wpdb Class

The wpdb class in WordPress is at the core of all database interactions between the core software and your database. It’s also used by both plugins and themes.

or  WP_Query

The WP_Query class is an extremely powerful WordPress query that you can use to access posts in your database. We’ve already covered WP_Query extensively on this blog before, so I’m really only just pointing it out here.

you may read the article

MySQL and WordPress: Understanding How Databases Work - WPMU DEV

A MySQL database is, essentially, the filing cabinet that holds all of the information on your WordPress site. Here’s everything you need to know about how MySQL works with WordPress in one handy guide.

https://wpmudev.com/blog/mysql-databases/

Also you need to know how a template works see

How to Create WordPress Theme from Scratch: A Beginners Guide

Is creating a WordPress theme seems quite similar to open a Pandora box to you? No issues ...Read on to create WordPress theme from scratch painlessly.

https://blog.templatetoaster.com/create-wordpress-theme-scratch/

actually create a template with WP_QUERY, and display the results

by (95.8k points)
...