Add active class to wp_nav_menu

You wont need that PHP code to style links to the current page in your nav. WordPress adds a class (current-menu-item) by default on links to the current page. But WordPress does not style the link for you. That would be part of the theme. You can add a rule to the theme’s CSS ( … Read more

Override the WordPress default pagination markup

do you mean post archive pagination? The paginate_links() function accepts a type parameter, so if all you need is a ul > li format you could try out something like: // archive pagination global $wp_query; $big = 999999999; // need an unlikely integer echo paginate_links( [ ‘base’ => str_replace( $big, ‘%#%’, esc_url( get_pagenum_link( $big ) … Read more