Login to wordpress using another sites authentication.

What you’re after is called Single Sign On or SSO. You would essentially be bypassing WordPress’ authentication methods and use those from a 3rd party. WordPress needs a local user of some kind for normal operations to work (the user_can() function for example.) So the general gist would be something like this – Send any … Read more

Remove   in post content

As per comments on the original post, it appears this is as a result of copying text from another source. Unfortunately, copying and pasting can bring across whatever junk the source editor decides to include. MS Word has typically been terrible at this; WordPress now does a pretty good job at cleaning it up but … Read more

Removing custom sort order from admin page listing

By default pages are order by menu_order then title. When you are adding filter country you are ordering them by meta_value There are two options Remove everything that you added country and orderby pages will be back to default order. If you can not remove orderby but can remove country then adjust your code in … Read more

Creating an admin meta box to save post as pending

The reason your code does not work is that the if-statement checking isset( $_POST[‘wp_cfc_save_meta_box’]) never evaluates to true. Your code generating the submit button, <?php submit_button( __( ‘Save as Pending’ ), ‘secondary button-large’, ‘Publish’, false ); ?> yields the following HTML: <input type=”submit” name=”Publish” id=”Publish” class=”button button-large” value=”Save as Pending” /> WordPress’ submit_button function takes … Read more

Custom posts password protect

Use post_password_required() function to check if the post is protected. <?php global $post; $p = $post; // can be post object. // $p = $post->ID; // also can be post ID. $this_post_type = get_post_type( $p ); if ( ‘my_custom_post_type’ === $this_post_type ) { // check the post type. if ( ! post_password_required( $p ) ) … Read more

How can I use custom menus with a Bootstrap WordPress theme?

You can change the classes of the <ul> by adding ‘menu_class’=>’nav navbar-nav’ to your $args array. Remember, this parameter overwrites all the classes, so add “menu” as well if you want many themes and plugins to work! If you don’t want the outer <div>, you can “unwrap” the <ul> by adding ‘container’=>false. $args = array( … Read more