Mikel
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Need help with a codeHere is my code
<?php // change the path to your wp-load.php file require_once('/home/surepayf/public_html/wp-load.php'); //$output = shell_exec('wp post list --category_name="FREE CONTENT" --format=ids 2>1&'); //echo $output."\n"; global $wpdb; $oldCatSlug = 'free-content'; $newCatSlug = 248; // you need to insert an integer here that matches your SPECIAL category $category = get_category_by_slug( $oldCatSlug ); if ( $category ) { $posts = get_posts( array( 'numberposts' => -1, 'category_name' => 'FREE CONTENT', ) ); if ( $posts ) { foreach ( $posts as $post ) { // update categories the match FREE // see https://codex.www.ads-software.com/Function_Reference/wp_set_post_categories wp_set_post_categories( $post->ID, $newCatSlug, false ); // set this to true if you want this category appended } } } ?>
Forum: Fixing WordPress
In reply to: Need help with a codeOkay
Forum: Fixing WordPress
In reply to: Need help with a codeI saw this in the error_log file;
Connection refused.
Forum: Fixing WordPress
In reply to: Need help with a code@corrinarusso Here is what I got;
X-Powered-By: PHP/7.4.6
Set-Cookie: PHPSESSID=bc5f8ed5bbfbe6147eadcc423a737f7e; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Content-type: text/html; charset=UTF-8No post was moved too
Forum: Fixing WordPress
In reply to: Need help with a codeI have deactivated the LiteSpeed Cache plugin, will wait for the next 5mins
Forum: Fixing WordPress
In reply to: Need help with a codeOh.. Okay
Forum: Fixing WordPress
In reply to: Need help with a codeWhat does it mean… I set the Cron job to run every 5mins just to be sure, and I got that mail after 5mins, the post were not moved either
Forum: Fixing WordPress
In reply to: Need help with a code@corrinarusso Hi, I got this in my mail;
X-Powered-By: PHP/7.4.6
Set-Cookie: PHPSESSID=b1c8eeb08dac888059dec24224ce4d14; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
X-LiteSpeed-Cache-Control: no-cache
Content-type: text/html; charset=UTF-8Forum: Fixing WordPress
In reply to: Need help with a codeThanks so so much. I will update you
Forum: Fixing WordPress
In reply to: Need help with a codeSo, that means I can create the file anywhere?… Cos I don’t have a child theme
Forum: Fixing WordPress
In reply to: Need help with a codeThanks
Forum: Fixing WordPress
In reply to: Need help with a code@corrinarusso sorry to disturb you, please what do I enter in the command field in Cron job?
Forum: Fixing WordPress
In reply to: Need help with a codeOkay, Thanks so so much… I am deeply grateful
Forum: Fixing WordPress
In reply to: Need help with a codeOne more thing please, I have LiteSpeed Cache plugin running on my site, and to the best of my knowledge.. I think it uses WordPress Cron, is it safe if I disable the WordPress Cron and if I did not disable it, will it affect the code you just gave me?
Forum: Fixing WordPress
In reply to: Need help with a codeOkay.. thanks