How to edit the default database of WordPress [closed]
You can do that accessing the phpmyadmin dashboard of your host, but that is no the right way to do it, i recommend you to research and learn about: Custom Post Types Custom Taxonomies
You can do that accessing the phpmyadmin dashboard of your host, but that is no the right way to do it, i recommend you to research and learn about: Custom Post Types Custom Taxonomies
Like keepkalm said I’d find the list of post IDs from the database: select id, post_title FROM wp_posts where post_title like ‘%Pharmaton%’ or post_title like ‘%Winston Blu%’ or post_title like ‘%Kefir%’ or post_title like ‘%Tetradox%’ or post_title like ‘%Passport Sco%’; and then use the list of IDs with wp-cli’s wp post delete which accepts a … Read more
If you want to output the $id, you need to echo. Also be sure to use esc_attr() as a good security practice. <input type=”hidden” name=”id” value=”[insert_php]echo esc_attr( $id );[/insert_php]”> In addition, as was noted in another answer, you’re calling it an ‘id’, but you’re actually using the login (username). If all you need is the … Read more
Call a external script: Your function look like this: <?php function modify_posts() { $number_posts = 10; $offset = 0; $success=”success”; while ( ‘success’ === $success ) { $url = add_query_arg( array( ‘num’ => $number_posts, ‘off’ => $offset, ‘abs’ => urlencode( ABSPATH ) ), plugins_url( ‘remote_get.php’, __FILE__ ) ); $response = wp_remote_get( $url ); if ( … Read more
I check your query and it’s working fine without any errors or empty results. But in addition if you remove INNER JOIN from wp_terms table its also working because you are not getting anything from that table and it is not used in WHERE clause also. SELECT ID, `post_date` , `post_title` , `post_content` , `guid` … Read more
Why not just use WP_Query for this instead of inventing the wheel all over again? I’m pretty sure you can solve this with a meta query within your WP_Query. See the codex.
Fetching all tags of post: SELECT p.id, p.post_name, c.name, GROUP_CONCAT(t.`name`) as tag FROM wp_posts p JOIN wp_term_relationships cr on (p.`id`=cr.`object_id`) JOIN wp_term_taxonomy ct on (ct.`term_taxonomy_id`=cr.`term_taxonomy_id` and ct.`taxonomy`=’category’) JOIN wp_terms c on (ct.`term_id`=c.`term_id`) JOIN wp_term_relationships tr on (p.`id`=tr.`object_id`) JOIN wp_term_taxonomy tt on (tt.`term_taxonomy_id`=tr.`term_taxonomy_id` and tt.`taxonomy`=’post_tag’) JOIN wp_terms t on (tt.`term_id`=t.`term_id`) GROUP BY p.id order by p.id … Read more
I actually found the issue. It was in the foreach I found the issue where I had an unnecessary sql-query that i removed.
yes that’s possible, you can create your custom post type and use MySQL query to fetch from csv file, and use insert into post function within the loop. you can use LOAD DATA INFILE query to fetch from excel and then use wp insert post function to insert into db. the query will look like:- … Read more
It works … here is the code function updateNumbers() { /* numbering the published posts: preparation: create an array with the ID in sequence of publication date, / / save the number in custom field ‘article’ of post with ID / / to show in post (within the loop) use <?php echo get_post_meta($post->ID,’article’,true); ?> / … Read more