Warning: Undefined variable $post_id

Try this instead: $posts_with_category = new WP_Query( $args ); if( $posts_with_category->have_posts() ) { Instead of just checking if $posts_with_category is non-empty it checks if it’s an array of WP_Post objects. We don’t have line numbers to see where the error is being thrown. Is line 47 your return statement?

Error logging in wordpress

You’ll find error_log output in WordPress’s debug.log, under wp-content, if enabled in your web server’s error log file, e.g. /var/log/httpd/error_log for Apache, or /var/log/apache2/error_log on Ubuntu /var/log/nginx/default-error.log for nginx or in your PHP FPM service’s error log if you’re running that instead It generally won’t get output in the web page, no. If you want … Read more

Platform sh site setup in localhost gets Cookie error

Putting the code below in the settings.php file to boycott cookies solved my issue. define( ‘AUTH_KEY’, ‘put your unique phrase here’ ); define( ‘SECURE_AUTH_KEY’, ‘put your unique phrase here’ ); define( ‘LOGGED_IN_KEY’, ‘put your unique phrase here’ ); define( ‘NONCE_KEY’, ‘put your unique phrase here’ ); define( ‘AUTH_SALT’, ‘put your unique phrase here’ ); define( … Read more

SMTP email does not work even with the right firewall rules

Make the following test. Disable all of your SMTP plugins. Temporarily enable WP_DEBUG and WP_DEBUG_LOG in your “wp-config.php” file. Insert the following code in your theme “functions.php” file: add_action( ‘phpmailer_init’, function ( $phpmailer ) { $phpmailer->isSMTP(); $phpmailer->Port = 587; $phpmailer->SMTPAuth = true; $phpmailer->SMTPSecure=”tls”; $phpmailer->FromName = get_bloginfo( ‘name’ ); // Type your SMTP credentials below. $phpmailer->From … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)