Htaccess to redirect whole website to coming soon html page

To redirect an entire WordPress site to a specific HTML page using .htaccess, you can set up a redirect rule in the .htaccess file located in your site’s root directory. Add rewrite rules immediately after “RewriteEngine On” # Redirect all traffic to a specific HTML page RewriteEngine On RewriteCond %{REQUEST_URI} !^/specific-page.html$ # Prevent redirect loop … Read more

WordPress query_posts with multiple tax_query

You could build an intermediary array for the tax_query parameter: $tax_query = array(); $taxonomies = array( ‘product_cat’, ‘sub_category’, ); foreach ( $taxonomies as $taxonomy ) { if ( ! empty( $_POST[ $taxonomy ] ) ) { $tax_query[] = array( ‘taxonomy’ => $taxonomy, ‘terms’ => $_POST[ $taxonomy ], ); } } query_posts( array( // … ‘tax_query’ … Read more

WordPress links only showing as text on main blog page

By default, WordPress removes all HTML from automatic excerpts, preventing links from being displayed. To include links or other HTML elements in excerpts, you can set manual excerpts by simply adding the desired tags. If setting manual excerpts for each post isn’t feasible, you may consider using a plugin to customize excerpts automatically.

Adding a new custom post type using the editor causes 502 bad gateway error

I did some further research and testing, and found the issue to be related to nginx and not WordPress itself. The following Stack Overflow post included some configuration adjustments for the site’s config file that resolved the 502 bad gateway issues. My configuration file’s client_max_body_size was already set to 64M. Here are the nginx settings … Read more

Object of class WP_Filesystem_Direct could not be converted to string

In here: $filesystem = new WP_Filesystem_Direct( false ); $server = getcwd(); $path = $server . ‘/wp-content/uploads/on_this_day.txt’; $filesystem->get_contents($path); echo $filesystem; …note that $filesystem, in the last line, is the same variable that’s holding your WP_Filesystem object. Try this instead: $filesystem = new WP_Filesystem_Direct( false ); $server = getcwd(); $path = $server . ‘/wp-content/uploads/on_this_day.txt’; $file_content = $filesystem->get_contents($path); … Read more

Why is sanitize_text_field() selectively trimming data?

Can anyone explain it? The official docs for that function say it strips percent encoded characters. Checks for invalid UTF-8, Converts single < characters to entities Strips all tags Removes line breaks, tabs, and extra whitespace Strips percent-encoded characters https://developer.wordpress.org/reference/functions/sanitize_text_field/ It looks like it’s stripped out %ad and it has nothing to do with instances … Read more

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