How to request container_class from wp_nav_menu

Go with a custom Walker class Your_Walker_Nav_Menu extends Walker_Nav_Menu { var $container_class; public function __construct($container_class) { $this->container_class = $container_class; } function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { global $wp_query; $indent = ( $depth > 0 ? str_repeat( “\t”, $depth ) : ” ); // code indent // … Read more

Showing different pages depending on a cookie value

You could hook into the template redirect function. function my_page_template_redirect() { if ( isset( $_COOKIE[“myCookie”] ) ) { if( $_COOKIE[“myCookie”] == “en” ) { wp_redirect( ‘you path’ ); exit; } } } add_action( ‘template_redirect’, ‘my_page_template_redirect’ ); And you could better use wp_redirect() function to redirect inside WordPress.

How to append custom text to the output of ‘categories widget’?

To append text to the end of the titles in that widget and nothing more i.e. does not matter the URL, you can just use some CSS. <li> <a class=”my-folder-categories”>Category 1</a> </li> a.my-folder-categories-folder:after {content:” folder”; This will effectivly make the text appear as so: category 1 folder Be sure to add that space in the … Read more

How to custom post navigation

You could try combining these: Buttons next_posts_link( ‘Prev’ ); previous_posts_link( ‘Next’ ); Current page echo (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; Total pages wp_count_posts(); In HTML <?php next_posts_link( ‘Prev’ ); ?> <?php echo (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; ?> <span> of </span> <?php echo wp_count_posts(); ?> <?php next_posts_link( ‘Prev’ ); ?>