How to overwrite the category template in a plugin

I noticed that you’re using is_category() in your function, which means you’re targetting the default/core category taxonomy and not a custom taxonomy, hence you should instead use the category_template hook. E.g. add_filter( ‘category_template’, ‘load_new_custom_tax_template’); function load_new_custom_tax_template ($tax_template) { // I don’t check for is_category() because we’re using the category_template filter. return dirname( __FILE__ ) . … Read more

Links to previous/next month archives

Got it working! It’s not pretty but it’s functioning. $Y = get_the_time( ‘Y’ ); $M = get_the_time( ‘m’ ); $earlier_post = get_posts( [ ‘date_query’ => [ ‘before’ => [ ‘year’ => $Y, ‘month’ => $M, ‘day’ => 1, ], ], ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ‘posts_per_page’ => 1, ‘ignore_sticky_posts’ => 1 ] ); $prev_label … Read more

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