how to remove “Archive | ” from wordpress?

Deadly 提交于 2020-01-07 09:51:47

问题


how do you remove "Archive | " from wordpress category page and only show the category? is there a plugin or what code do i need to remove?

Thank you in advance ;-)


回答1:


What I imagine that you mean is that there is a header tag containing "Archive | " somewhere in your category page. If you want to get rid of this string, the first thing you should look for is whether or not this can be changed somewhere in a Theme Options Page (if applicable).

If you don't have a Theme Options Page, look for "category.php" in your theme folder. Inside there, you should be able to find "Archive | " fairly easily and remove it.

DO NOT DELETE ANY FILES!! If you're having trouble, post the contents of your theme's category.php file, and I'll be sure to try and help you further.




回答2:


To remove archive pages I use to do this way: remove the archive.php page from theme (most of time it's redundant and not needed, there already are tags and categories) and then add this small code snippet in index.php page of your theme. So users that try to fetch content adding years and months to your urls are redirected to standard 404 page.

if(is_archive()) {
    // force 404
    $wp_query->set_404();
    status_header( 404 );
    nocache_headers();
    include("404.php");
    die;
}

A longer post about that here: http://www.barattalo.it/2015/09/08/wordpress-remove-archive-pages/




回答3:


Try the WP No Category Base plugin.

It does remove the /category/ slug from your URL's, and hopefully it can also solve your question.




回答4:


Try to delete archive.php in your theme's folder.



来源:https://stackoverflow.com/questions/11583954/how-to-remove-archive-from-wordpress

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!