Hallo,
ich weiß, dieses Thema ist ein leidiges Thema, aber ich finde einfach nicht die Antwort auf mein Problem..
Auf meiner Seite gibt es jede Menge Produkte, diese sind mit folgender Struktur versehen:
http://www.festival-gadget.de/item/faltbares-solar-ladegeraet/
Nun möchte ich gerne aus SEO-technischen Gründen den Slug /item/ entfernen, sodass die URL direkt auf das Produkt verweist.
Ich nutze das Theme "Ebuy". Dort kann ichsogenannte "Goods" hinzufügen. Also ähnlich wie Beiträge, nur eben mit einer anderen Darstellung. Die Linkstruktur ist glaube ich in der post-types.php verankert und sieht so aus:
<?php
/* Goods post type*/
function post_type_goods() {
register_post_type(
'goods',
array( 'public' => true,
'publicly_queryable' => true,
'has_archive' => true,
'hierarchical' => false,
'menu_icon' => get_stylesheet_directory_uri() . '/images/box.png',
'labels'=>array(
'name' => _x('Goods', 'post type general name'),
'singular_name' => _x('Goods', 'post type singular name'),
'add_new' => _x('Add New', 'Goods'),
'add_new_item' => __('Add New Goods'),
'edit_item' => __('Edit Goods'),
'new_item' => __('New Goods'),
'view_item' => __('View Goods'),
'search_items' => __('Search Goods'),
'not_found' => __('No Goods found'),
'not_found_in_trash' => __('No Goods found in Trash'),
'parent_item_colon' => ''
),
'show_ui' => true,
'menu_position'=>5,
'query_var' => true,
'rewrite' => true,
'rewrite' => array( 'slug' => 'item', 'with_front' => FALSE,),
'register_meta_box_cb' => 'mytheme_add_box',
'supports' => array(
'title',
'thumbnail',
'custom-fields',
'comments',
'editor'
)
)
);
}
add_action('init', 'post_type_goods');
/* Movie genre taxonomy */
function create_products_taxonomy()
{
$labels = array(
'name' => _x( 'Product types', 'taxonomy general name' ),
'singular_name' => _x( 'Product type', 'taxonomy singular name' ),
'search_items' => __( 'Search Product types' ),
'all_items' => __( 'All Product types' ),
'parent_item' => __( 'Parent Product type' ),
'parent_item_colon' => __( 'Parent Product type:' ),
'edit_item' => __( 'Edit Product type' ),
'update_item' => __( 'Update Product type' ),
'add_new_item' => __( 'Add New Product type' ),
'new_item_name' => __( 'New Product type Name' ),
);
register_taxonomy('product',array('goods'), array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'query_var' => true,
'rewrite' => array( 'slug' => 'product' ),
));
}
add_action( 'init', 'create_products_taxonomy', 0 );
/* ADD FEATURED TERM */
function add_product_term_featured() {
if(!is_term('Featured', 'product')){
wp_insert_term('Featured', 'product');
}
}
add_action( 'init', 'add_product_term_featured' );
?>
Alles anzeigen
Leider habe ich gar keine Ahnung an welche Stelle ich zu meiner gewünschten URL komme und was ich dafür tun muss, damit die URL auch wieder erreichbar ist. Kann ich in meine Datenbank gehen und dort an den gewünschten Stellen das /item/ entfernen? (MySQL Grundlagen habe ich). Oder reicht es das Ganze in der .htaccess zu machen und wenn ja, was muss ich dazu eintragen? Habe das Tool von Yoast gefunden, aber es erschließt sich mir einfach nicht..
Hoffe auf eure Hilfe!