This topic has 7 replies, 2 voices, and was last updated 10 years by Radu.

  • Author
  • #115545
     tollyitpros
    Participant

    Hello,

    I’ve added the piece of code found here: https://archived.seventhqueen.com/kleo/article/disable-clients-testimonials-portfolio-post-types to the child theme but it still shows those in the admin panel and top bar, do I need to trigger something to enforce the changes?

    Regards,

    Rishi

     

    #115754
     Radu
    Moderator

    Hi,

    Try this solution

    https://archived.seventhqueen.com/forums/topic/how-to-unregister-clients-testimonials-and-portfolio-from-the-theme

    Let me know

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #116442
     tollyitpros
    Participant

    That only worked partly, I still can see the Clients, Testimonials or Portfolio from the top wp admin bar (from the “+New” menu option.

    #116594
     Radu
    Moderator

    Remove that snippet and replace it with this

    https://archived.seventhqueen.com/kleo/article/disable-clients-testimonials-portfolio-post-types

    Let me know

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #116721
     tollyitpros
    Participant

    Hi Radu,

    I had tried that intially but gave it another try, ensuring I copied the code correctly. This piece of code doesn’t work for me and display all 3 again.

    #116866
     Radu
    Moderator

    Add both functions this to functions.php child theme

    COPY CODE
    
    
    function remove_menu_links() {
    	remove_menu_page( 'edit.php?post_type=kleo_clients' );
    	remove_menu_page( 'edit.php?post_type=kleo-testimonials' );
    	remove_menu_page( 'edit.php?post_type=portfolio' );
    }
    add_action( 'admin_init', 'remove_menu_links', 9999 );
    
    function remove_admin_bar_links() {
        echo "<style>\n";
        echo '#wp-admin-bar-new-kleo-testimonials,#wp-admin-bar-new-kleo_clients,#wp-admin-bar-new-portfolio { display: none !important;}';
        echo "\n</style>";
    
    }
    add_action( 'wp_before_admin_bar_render', 'remove_admin_bar_links' );

    Cheers

    Radu

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #117498
     tollyitpros
    Participant

    Thanks Radu, that’s working now.

    #117669
     Radu
    Moderator

    Great

    Have a nice week

    Cheers

    RAdu

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 8 posts - 1 through 8 (of 8 total)

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?