White screen on home page after migration; no errors
I found it. I guess WP Engine uses a random database table name prefix rather than this default in wp-config.php: $table_prefix = ‘wp_’;
I found it. I guess WP Engine uses a random database table name prefix rather than this default in wp-config.php: $table_prefix = ‘wp_’;
Add this to your theme functions file: // This will occur when the comment is posted function plc_comment_post( $incoming_comment ) { // convert everything in a comment to display literally $incoming_comment[‘comment_content’] = htmlspecialchars($incoming_comment[‘comment_content’]); // the one exception is single quotes, which cannot be #039; because WordPress marks it as spam $incoming_comment[‘comment_content’] = str_replace( “‘”, ‘'’, … Read more
I think this is the most relevant solution to your problem. You just check it out: Possible solution Possible solution
And why not using simple wordpress code, changing args ? $args = array( ‘post_type’ => ‘post’, ‘orderby’ => ‘rand’, ‘posts_per_page’ => ‘1’, ); $my_query = new WP_Query( $args ); if ( $my_query->have_posts() ) { while ( $my_query->have_posts() ) { $my_query->the_post(); /* do your post output here */ } // end while } // end if
The init hook is called too early for your needs. And you should use wp_redirect(). Try this: function contactusnot() { if ( ! is_user_logged_in() && (is_page( 220 ) || is_page( ‘Contact us’ ) || is_page( ‘contact-us’ ))) { wp_redirect( ‘https://google.com/’ ); exit; } } add_action( ‘template_redirect’, ‘contactusnot’ );
As third-party plugin/library recommendations are not on-topic on this StackExchange, the next best option is a code-based solution. If you can describe why you can’t use a code-based solution I could possibly provide a better answer. You can accomplish this using some simple JavaScript event listeners on the <select> element. This would require you to … Read more
I might not be fully awake, but it seems to me the operator should be “and”, not “or”: if ( ! is_single() && ! is_page( ‘about’ ) ) { get_sidebar(); } The is_single() checks if the main query is for a single post, and is_page() checks if the main query is for a specified page. … Read more
Can you explain how did you put the search form? Are you working in code or with any page builders? Assuming you are using code, best case is to use Javascript / Ajax to search in the same page. Other options include submitting the search form and reloading the page with data. You can add … Read more
Try the use clause: add_filter( ‘pre_get_document_title’, function ( $title ) use ( $custom_document_title ) { … } ); You can remove the global $custom_document_title; line with use.
The documentation for the posts endpoint does not indicate that meta_key or meta_value are accepted parameters. You will likely have most success by defining your own endpoint to accept those parameters. This question may be helpful: REST API and filtering by meta value