Why does the ‘wp_nav_menu’ function work only until a menu is created?

This is due to the wp_nav_menu parameter fallback_cb: If the menu doesn’t exist, a callback function will fire. Default is ‘wp_page_menu’. Set to false for no fallback. You have not specified an alternative, so it uses the default, wp_page_menu. You could create your own function to display a page menu with the proper markup, or … Read more

Single Page theme [closed]

There are plenty of one page themes for WordPress _ here’s a recent link to some of them >>> https://colorlib.com/wp/best-one-page-wordpress-themes/ _ and another one with one page themes that are free >>> https://www.codeinwp.com/blog/free-one-page-wordpress-themes/ i suspect you might be looking for more detail about ‘customizable’ but you would need to clarify your question by giving a … Read more

editing fonts of category links from the_category() funtion

If you are using the_category() (so without passing parameters), the result will be something like: <ul class=”post-categories”> <li><a href=”https://wordpress.stackexchange.com/questions/262546/cat1″>Category 1</a><li> <li><a href=”http://wordpress.stackexchange.com/cat2″>Category 2</a><li> </ul> So a css line like .post-categories li a {font-family:Myfont;} should do it. Reference: the_category() calls get_the_category_list, which does the actual output. This function ends with a filter, which you could use … Read more

Multiple WordPress Menus that will only display all pages

The keys for the array passed to register_nav_menus() should correspond with the ‘theme_location’ arguments in your calls to wp_nav_menu(). Since they do not, WordPress is unable to locate the appropriate menu and displays a default consisting of all top-level pages instead. Either change your ‘theme_location’ arguments to ‘menu-1’ and ‘menu-2’ or change the array keys … Read more

Tried in different ways but sidebar not working?

add_action( ‘widgets_init’, ‘Y_widget_register’ ); You have a typo – use underscores. Here is the working piece: function Y_widget_register() { register_sidebar(array( ‘name’ => esc_html__(‘Sidebar’, ‘Y-07’), ‘id’ => ‘y-sidebar’, ‘description’ => ‘Dynamic Right Sidebar’, ‘before_widget’ => ‘<section id=”%1$s” class=”y-widget %2$s”>’, ‘after_widget’ => ‘</section>’, ‘before_title’ => ‘<h2 class=”y-widget-title”>’, ‘after_title’ => ‘</h2>’ )); } add_action(‘widgets_init’, ‘Y_widget_register’);