The ( error_log ) file size is very large

Turn off the debug error loggins with this command in the wp-config.php file: define( ‘WP_DEBUG’, false ); The errors you are seeing are ‘warning’ (I think of them as ‘benign’) and have to do with coding practices not allowing for empty ‘loop’ variables. You only want the WP_DEBUG to be true on development systems. If … Read more

How to display image ALT under image?

<script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js”></script> <img class=”logo” src=”https://pbs.twimg.com/media/B5aXOWzIMAA1DoS.png” alt=”flower”> <script type=”text/javascript”> $(document).ready(function(){ var alt_name=$(‘.logo’).attr(‘alt’); alert(alt_name); }); </script>

WordPress Plugin Reviewer

You can use sanitization and escaping functions that WordPress provides for example, you might need to do this: $sanitize_value = sanitize_text_field( $_POST[$this->unique] ); Here are the detail that you needed. https://codex.wordpress.org/Validating_Sanitizing_and_Escaping_User_Data

Rest API does not work after changing WordPress Theme

I manage to solved it by adding this code (at the bottom) to the YOUR BLOG THEMES my path : wp-content/themes/MYWPTHEME/function.php function ws_register_images_field() { register_rest_field( ‘post’, ‘images’, array( ‘get_callback’ => ‘ws_get_images_urls’, ‘update_callback’ => null, ‘schema’ => null, ) ); } add_action( ‘rest_api_init’, ‘ws_register_images_field’ ); function ws_get_images_urls( $object, $field_name, $request ) { $medium = wp_get_attachment_image_src( get_post_thumbnail_id( … Read more

Display post of current parent category, and in right hand side show child category post

To display posts only from current category, without posts from sub-categories, use pre_get_posts action hook to set ‘include_children’ => FALSE in tax_query parameter. add_action( ‘pre_get_posts’, ‘se342950_no_child_term_posts’ ); function se342950_no_child_term_posts( $query ) { if ( is_admin() || ! $query->is_main_query() || ! $query->is_category() ) return; $tax_obj = $query->get_queried_object(); $q_tax = [ ‘taxonomy’ => $tax_obj->taxonomy, ‘terms’ => $tax_obj->term_id, … Read more

pagination leads to 404 page

After an exhausted effort of a whole day finally find the solution. i write these two functions in my functions.php file and finally i got the expected result. function remove_page_from_query_string($query_string) { if ($query_string[‘name’] == ‘page’ && isset($query_string[‘page’])) { unset($query_string[‘name’]); // ‘page’ in the query_string looks like ‘/2’, so i’m spliting it out list($delim, $page_index) = … Read more