vincegx
Forum Replies Created
-
Forum: Plugins
In reply to: [Add Clone Sites for WPMU (batch)] images aren′t cloningHi,
The plugin is not fully compatible with wordpress 3.5 because uploads directory are complety different in wordpress < 3.5 .
In wordpress < 3.5, wordpress use wp-content/blog.dir/files directory while wordpress > 3.5 use wp-content/blog.dir/files
In the case of wordpress MU, wordpress separate blog folder into wp-content/uploads/sites
So i replace some hook to have FULLY compatible with wordpress 3.5 and older version
Just Edit magic-add-cloned-sites.php and changes :
1/ line 196
Change line
$fileupload_url = $full_url . "/files";
TO
/// Hook - Test if wordpress version is < 3.5 -- blog.dir upload different - VinceGx if ( get_bloginfo('version') >= 3.5 ): $fileupload_url = $full_url . "/"; elseif ( get_bloginfo('version') < 3.5 ): $fileupload_url = $full_url . "/files"; endif;
2/ line 254 / 255
Change line
$dir_to_copy = ABSPATH . 'wp-content/blogs.dir/' . $template_id . '/files'; $dir_to_copy_into = ABSPATH .'wp-content/blogs.dir/' . $new_blog_id . '/files';
TO
/// Hook - Test if wordpress version is < 3.5 -- blog.dir upload different - VinceGx if ( get_bloginfo('version') >= 3.5 ): $dir_to_copy = ABSPATH . 'wp-content/uploads/sites/' . $template_id; $dir_to_copy_into = ABSPATH .'wp-content/uploads/sites/' . $new_blog_id; elseif ( get_bloginfo('version') < 3.5 ): $dir_to_copy = ABSPATH . 'wp-content/blogs.dir/' . $template_id . '/files'; $dir_to_copy_into = ABSPATH .'wp-content/blogs.dir/' . $new_blog_id . '/files'; endif;
1/ line 205
Change line
update_blog_option ($new_blog_id, 'upload_path', 'wp-content/blogs.dir/' . $new_blog_id . '/files');
TO
/// Hook - Test if wordpress version is < 3.5 -- blog.dir upload different - VinceGx if ( get_bloginfo('version') < 3.5 ): update_blog_option ($new_blog_id, 'upload_path', 'wp-content/blogs.dir/' . $new_blog_id . '/files'); endif;
That’s it!
And normally when you copy any blog , folder are created into wp-content/uploads/sites/
And the Guy who buid the theme say
For the home page and portfolio archive page, you create pages with custom template set up (Home slides or Portfolio page). You may want to check how Yoast handles that, I believe for Yoast it looks different, not like the regular page and this is why it ignores what you enter in page settings.
….
Yes , i change for True ….but no resolution ….. and delete the similar declaration of has_archive …. same problem ….
add_action( 'init', 'create_my_post_types' ); function create_my_post_types() { register_post_type( 'pb_portfolio', array( 'labels' => array( 'name' => __('Photos', "pb"), 'singular_name' => __('Portfolio item', "pb"), 'add_new_item' => __('Add new Portfolio item', "pb"), 'edit_item' => __('Edit Portfolio item', "pb"), 'view_item' => __('View Portfolio item', "pb"), 'search_items' => __('Search Portfolio items', "pb"), 'not_found' => __('No Portfolio items found', "pb"), 'not_found_in_trash' => __('No Portfolio items found in Trash', "pb"), ), 'public' => true, 'show_in_nav_menus' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'hierarchical' => false, //'menu_position' => 5, //'menu_icon' => get_bloginfo('template_directory') . "/images/admin_icons/projection-screen.png", 'supports' => array('title', 'editor', 'thumbnail', 'excerpt', 'comments', 'custom-fields'), 'has_archive' => 'portfolio', ) ); register_post_type( 'pb_homeslide', array( 'labels' => array( 'name' => __('Home slides', "pb"), 'singular_name' => __('Home slide item', "pb"), 'add_new_item' => __('Add new Home slide item', "pb"), 'edit_item' => __('Edit Home slide item', "pb"), 'view_item' => __('View Home slide item', "pb"), 'search_items' => __('Search Home slides', "pb"), 'not_found' => __('No Home slides found', "pb"), 'not_found_in_trash' => __('No Home slides found in Trash', "pb"), ), 'has_archive' => true, 'public' => true, 'exclude_from_search' => true, 'show_in_nav_menus' => true, //'menu_position' => 5, //'menu_icon' => get_bloginfo('template_directory') . "/images/admin_icons/projection-screen.png", 'supports' => array('title', 'thumbnail', 'custom-fields'), 'has_archive' => false, 'rewrite' => array('with_front' => true, 'slug' => 'hs' ), ) ); }
Thx professor for my mistakes in English ??
it’s true, I do not see my custom post type archive in the section ‘title’ of your plugin …..
Yes for sure , but just for the custom post type, not for the archive dépend of custom post type …..
Verify Joost , à lot of post and forum speak about this problem …..12 hours about this problem , perhaps 100 post read And Tryed noi solution …… U want URL of my website ?
for information exactly the same problem …
ok ! ok I’ll try to be more explicit !
your plug-in and also all in one seo have a problem with the “custom post type” and the archive page.I read in many forums and website, when using an archive page, which lists “custom post type” associated, no title or description (title and description filled with plugin) are displayed.
I must complete two pages on my archive with titles and descriptions like this.
<?php if(is_home() && $post_type != 'plugin') { echo '<meta name="description" content="descriptifbablabal"/>'."\n"; echo '<link rel="canonical" href="' . esc_url( get_permalink( get_queried_object() ), null, 'other' ) . '" />'."\n"; } elseif( $post_type == 'plugin2' && is_null($plug3)) { echo '<meta name="description" content="blabla2"/>'."\n"; echo '<link rel="canonical" href="' . esc_url( get_permalink( get_queried_object() ), null, 'other' ) . '" />'."\n"; }?>
For Pages “custom post type”, it works by the section title of your plugin, but for the archive pages your plugin does not work ….
U’r understand better ?
Thx Joost