WordPress永久連結外掛Permalink Manager Pro
WordPress永久連結外掛Permalink Manager Pro是最先進但使用者友好的 WordPress 永久連結外掛。 可以輕鬆控制貼文、頁面、自訂貼文類型、類別、標籤、自訂分類法和 WooCommerce 商店的所有永久連結。 只需點擊幾下,它還可以幫助您恢復永久連結或替換 URL 中的任何單字。
永久連結用於連結到特定的部落格或論壇帖子,以及社交網路上的用戶個人資料。 常規連結有時包含大量服務資訊(會話編號、網站的當前部分等)。 永久連結更簡潔、易於閱讀,並且只包含前往所需頁面的資訊。
示範: https://permalinkmanager.pro/
主題:多功能WordPress主題Qwery + RTL
特點 :WordPress永久連結插件Permalink Manager Pro Pro
- 自訂 WooCommerce 永久連結
- 自訂貼文類型和分類永久連結
- 一次編輯多個固定連結
- 自動重定向舊的永久連結
- 將自訂欄位新增至 WordPress 永久連結
- 重複的永久連結蛞蝓
建議:WordPress優化外掛程式WP-Optimize Premium
Changelog:
= 2.2.20 (October 10, 2022) = * Fix - The URLs with duplicated slashes (eg. example.com/sample-page////) are now handled correctly and forwarded to the canonical URL. * Fix - The redirect problem was resolved with WPForo versions after 2.0.1 * Dev - Improved compatibility with the WP All Import plugin functions * Dev - Improved compatibility with Polylang plugin * Dev - Better support for ACF Relationship fields * Dev - The plugin no longer (by default) supports custom post types & taxonomies that do not have the "query_var" and "rewrite" properties * Enhancement - In "Exclude drafts" mode, the URI Editor field in the "Quick Edit" section becomes "read-only" for the "Draft" posts. = v2.2.19.3 (August 11, 2022) = * Dev - New filter added - 'permalink_manager_pre_sanitize_title' * Fix - The old slugs are saved in the '_wp_old_slug' meta key even if the native slugs are changed in the URI Editor in the Gutenberg mode. * Fix - Extra security check in the "Debug" section to prevent unauthorized users (CSRF) from removing the plugin's data.
去掉這個字 產品 在路徑中
/*
* Code Remove /product/ or /shop/ ... that supports the %product_cat% format
* Replace /shop/ with your current slug
*/
function devvn_remove_slug( $post_link, $post ) {
if ( !in_array( get_post_type($post), array( 'product' ) ) || 'publish' != $post->post_status ) {
return $post_link;
}
if('product' == $post->post_type){
$post_link = str_replace( '/cua-hang/', '/', $post_link ); //Replace shop with your current slug
}else{
$post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link );
}
return $post_link;
}
add_filter( 'post_type_link', 'devvn_remove_slug', 10, 2 );
/*Fix 404 error after removing product slug or shop*/
function devvn_woo_product_rewrite_rules($flash = false) {
global $wp_post_types, $wpdb;
$siteLink = esc_url(home_url('/'));
foreach ($wp_post_types as $type=>$custom_post) {
if($type == 'product'){
if ($custom_post->_builtin == false) {
$querystr = "SELECT {$wpdb->posts}.post_name, {$wpdb->posts}.ID
FROM {$wpdb->posts}
WHERE {$wpdb->posts}.post_status="publish"
AND {$wpdb->posts}.post_type="{$type}"";
$posts = $wpdb->get_results($querystr, OBJECT);
foreach ($posts as $post) {
$current_slug = get_permalink($post->ID);
$base_product = str_replace($siteLink,'',$current_slug);
add_rewrite_rule($base_product.'?
去掉這個字 產品分類 在路徑中
/* * Remove product-category in URL * Replace product-category with your current slug. Default is product-category */ add_filter( 'term_link', 'devvn_product_cat_permalink', 10, 3 ); function devvn_product_cat_permalink( $url, $term, $taxonomy ){ switch ($taxonomy): case 'product_cat': $taxonomy_slug = 'product-category'; //Replace it with your current slug. Default is product-category if(strpos($url, $taxonomy_slug) === FALSE) break; $url = str_replace('/' . $taxonomy_slug, '', $url); break; endswitch; return $url; } // Add our custom product cat rewrite rules function devvn_product_category_rewrite_rules($flash = false) { $terms = get_terms( array( 'taxonomy' => 'product_cat', 'post_type' => 'product', 'hide_empty' => false, )); if($terms && !is_wp_error($terms)){ $siteurl = esc_url(home_url('/')); foreach ($terms as $term){ $term_slug = $term->slug; $baseterm = str_replace($siteurl,'',get_term_link($term->term_id,'product_cat')); add_rewrite_rule($baseterm.'?
⭐另請參閱:免費高級 WordPress 外掛摘要、每日更新
載永久連結管理器專業版 v2.4.4.3
筆記: 也許你需要在安裝插件之前解壓縮。 如果任何主題/外掛包含病毒,我們不提供任何保證。 在 localhost 上使用之前,請檢查 Virustotal。