How to make category for word post_content

I personally find it easier to use built-in WP functions rather than running straight MySQL queries, so here’s one option: <?php global $wpdb; // replace ‘yoursearchword’ with whatever you’re looking for. // the two % symbols are to find the word no matter what comes before or after. $query = “SELECT * FROM wp_posts WHERE … Read more

How to create a table [closed]

Here you go Javier, this should work. I included comments within the code to try and show you where things needed to change and added a few things you were missing. I’ll explain more below. <?php /* Should really come up with something more unique and related to your plugin */ function yourplugin_dbcreation() { global … Read more

Where are database files of a WordPress website?

But surprisingly, not many threads show where these files exactly are in the server. WordPress doesn’t have files it manages, it instead relies on MySQL/MariaDB for database storage and execution. So you will not find the database stored as a file within a WordPress installation. If you need to handle database data in a file … Read more

Custom wordpress SQL statement for a website

I think this could be life saver for you . This is a simple function for creating multiple loops. It retrieves a list of latest posts or posts matching criteria. <?php $posts_array = get_posts( $args ); ?> <?php $args = array( ‘numberposts’ => 5, ‘offset’ => 0, ‘category’ => , ‘orderby’ => ‘post_date’, ‘order’ => … Read more