Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter edmin

    (@edmin)

    I have since figured out what was causing this – it is an incompatibility with a plugin called ‘WordPress iHostname Migration’ which is what was replacing the hostname with %%site_url_token%% and failing to set it back again. Once disabled, everything works fine!

    The above appears a little overcomplicated; a slimmer version would be:

    // highlight active custom post page in nav
    add_filter( 'nav_menu_css_class', 'namespace_menu_classes', 10, 2 );
    function namespace_menu_classes( $classes , $item ){
    	if ( get_post_type() == 'YOUR_CUSTOM_POST_TYPE' ) {
    		// remove unwanted classes if found
    		$classes = str_replace( 'current_page_parent', '', $classes );
    		// find the url you want and add the class you want
    		if ( $item->url == '/PATH_TO_YOUR_ARCHIVE' ) {
    			$classes = str_replace( 'menu-item', 'menu-item current_page_parent', $classes );
    		}
    	}
    	return $classes;
    }

    Once you change YOUR_CUSTOM_POST_TYPE to the machine name of your custom post name, this should add the class ‘current_page_parent’ to your active custom post menu item, and remove the same class from any other menu items.

    Also, change ‘/PATH_TO_YOUR_ARCHIVE’ to the actual path of your archive.

    For example, in the below I have a custom post type called ‘Children’s Books’, and set up the post type like so (in functions.php):

    add_action( 'init', 'create_post_type' );
    function create_post_type() {
    	register_post_type( 'childrens_books',
    		array(
    			'labels' => array(
    				'name' => __( 'Children's Books' ),
    				'singular_name' => __( 'Children's Book' )
    			),
    		'public' => true,
    		'has_archive' => true,
    		'rewrite' => array('slug' => 'childrens-books'),
    		)
    	);
    }

    In order for the menu items to highlight properly I would use the following (again, in functions.php):

    // highlight active custom post page in nav
    add_filter( 'nav_menu_css_class', 'namespace_menu_classes', 10, 2 );
    function namespace_menu_classes( $classes , $item ){
    	if ( get_post_type() == 'childrens_books' ) {
    		// remove unwanted classes if found
    		$classes = str_replace( 'current_page_parent', '', $classes );
    		// find the url you want and add the class you want
    		if ( $item->url == '/childrens-books' ) {
    			$classes = str_replace( 'menu-item', 'menu-item current_page_parent', $classes );
    		}
    	}
    	return $classes;
    }

    Please add this to the documentation – I have been scratching my head over this one!

    Yep, seeing the same issue

    Im seeing the same behaviour carinallc – although I did see a post of yours over on the WP-FB AutoConnect project page

    Add the following to your wp-config.php file and it should work.

    define( 'BP_ENABLE_USERNAME_COMPATIBILITY_MODE', true );

    It will change the behaviour of BP such that is does use the auto-generated username rather than the full name received from Facebook. Once done, the plugin works well with BuddyPress.

    I did try this, but found that the blue ‘login with facebook’ buttons are now missing…

    Hi all,

    I have found that simply leaving a leading slash ‘/’ on your upload URL will cause this problem.

    Settings > Miscellaneous > Store uploads in this folder

    Make sure this is set to:

    wp-content/uploads

    and not

    /wp-content/uploads

    Hope that helps someone!

Viewing 6 replies - 1 through 6 (of 6 total)