Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1317258
    Daberechi
    Participant

    My website has many pages that should display posts. I’m trying to avoid creating too many pages by just substituting my pages in the menu with categories.
    However I find that the categories page has an archive page and title that I can’t change, how do I edit these?

    Also my site has two menus, when I add the categories to my second menu and click on it, it goes to the archive page which reverts to my first menu. How do I edit the menu and change it to my second menu?

    #1317399
    Christian
    Moderator

    Hey there,

    To edit the archive page title, go to Post > Categories and edit your category. You’ll see an Archive Title and Archive Subtitle.

    I’m not sure what the issue is with your menu. Please give us more details, screenshots, the URL of the page in question and access to your WordPress admin.

    Thanks.

    #1317544
    Daberechi
    Participant

    Thank you. I have two menus on my website. You’ll find pictures of both attached. The first one is my main menu and the second one comes up when I open a different page. I’m trying to replace my pages with categories, but when the archive page comes up it switches to the first menu. I want the second menu to be displayed on the categories archives page

    Also I can’t give access to my site because it has been whitelisted and I’m trying to optimize it.

    #1317621
    Rupok
    Member

    Hi there,

    Thanks for writing back. So the primary menu is being used on the category page, right? I think it’s usual because you can’t set menu individually for the category pages and the primary menu will be used unless you do something with custom development.

    Cheers!

    #1317650
    Daberechi
    Participant

    Yes, What can I do/how do I go about custom developing it?

    #1318365
    Rad
    Moderator

    Hi there,

    Please add this code to your child theme’s functions.php

    function category_menu( $args )
    {
    	if( 'primary' == $args['theme_location'] && is_category() )
    	{
    		switch( get_queried_object()->term_id ) { 
    			case 234 : $args['menu'] = 'your_menu_name_1'; break;
    			case 235 : $args['menu'] = 'your_menu_name_2'; break;
    			case 236 : $args['menu'] = 'your_menu_name_3'; break;
    		}
    	}
    
    	return $args;
    }
    
    add_filter( 'wp_nav_menu_args', 'category_menu' );

    The ID 234, 235, and 236 are your category ID, you should change them and add more line for your preference. Then your_menu_name_1, your_menu_name_2, and your_menu_name_3 are your menu name created at Admin > Appearance > Menus.

    Thanks!

    #1318789
    Daberechi
    Participant

    What do you mean by I should change them? I’ve updated my functions and I put my menu names but this didn’t change my first menu to my second menu in the archive page. Also how do I the text that says “below you will find a list of all the posts that have been categorized as “Art”?

    #1318830
    Daberechi
    Participant

    How do i display posts from the same category on my page without the use of a plugin?

    #1319612
    Rue Nel
    Moderator

    Hello There,

    Would you mind providing us the url of your site with login credentials so we can take a closer look and fix the issue? This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    To do this, you can make a post with the following info:
    – Link to your site

    – WordPress Admin username / password

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    By the way, you can create a page in Cornerstone and with the use of the recent posts elements, you can display posts with the same category.

    Thank you.

  • <script> jQuery(function($){ $("#no-reply-1317258 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>