category id (term_id) in url instead of slug

Try this. Here is the full code that you can add to your functions.php file: // Add custom rewrite rules function add_custom_rewrite_rules() { add_rewrite_rule( ‘^category/([0-9]+)/?$’, ‘index.php?term_id=$matches[1]’, ‘top’ ); flush_rewrite_rules(false); // Temporarily set this to true to flush rules, then set back to false } add_action(‘init’, ‘add_custom_rewrite_rules’); // Add term_id to query vars function add_query_vars($vars) { … Read more

WordPress Related Posts by Title and Category

Probably the simplest approach is to combine the category query with a search query (untested): $cat_query = new WP_Query( array( ‘cat’ => $cat_id, ‘post__not_in’ => array( get_the_ID() ), ‘no_found_rows’ => false, ‘posts_per_page’ => 6, ) ); $title_query = new WP_Query( array( ‘post__not_in’ => array( get_the_ID() ), ‘s’ => get_the_title(), ‘no_found_rows’ => false, ‘posts_per_page’ => 6, … Read more

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