register_post_type not working in wordpress 3.6
I changed ‘capability_type’ to ‘post’ and it started working
I changed ‘capability_type’ to ‘post’ and it started working
add_action( ‘pre_get_posts’, ‘mytheme_restrict_user_content’ ); function mytheme_restrict_user_content( $query ){ $restricted_post_types = array(‘documentlibrary’, ‘events’); if ( is_main_query() && is_singular($restricted_post_types) && ! is_user_logged_in() ) { $redirect = set_url_scheme(‘http://’ . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’]); wp_redirect( wp_login_url($redirect, true) ); exit(); } } I don’t use auth_redirect because that function check if the user is logged in, but we already know that … Read more
Copy header.php to your child theme so you’re not editing the parent theme’s file. And on line 49, you will see this line of code: if ( ! empty( $header_image ) ) : ?> This says if header image is not empty show the header image. So you can add to that condition to check … Read more
http://codex.wordpress.org/Plugin_API/Action_Reference/admin_print_scripts echos inline javascript in all admin pages header but http://codex.wordpress.org/Plugin_API/Action_Reference/admin_print_scripts-%28hookname%29 echos inline javascript in specific admin page header passed as second parameter.
Well actually I am not sure if it’s the best way to go, but you could just combine what you are already doing into two steps. Have the form submit without the _parent target so that it stays in fancybox. But if login is a success, then use that auto-closing behavior that you mentioned by … Read more
The callbacks hooked onto ‘all’ are called prior to the callbacks for any hook (action and filters) being called. (See source) add_action( ‘all’, ‘wpse115617_all_hooks’ ); function wpse115617_all_hooks(){ //This is called for every filter & action //You can get the current hook to which it belongs with: $hook = current_filter(); } See http://queryposts.com/function/current_filter/
You can’t use an action or hook within a function in the way you are expecting. Actions and hooks are about delayed execution You are attaching code that will execute at a later point. After an action is added, your function will continue as normal. Then when the user is actually being registered, your code … Read more
In functions.php: function myExcerpt($text) { $text = str_replace(‘]]>’, ‘]]>’, $text); $text = strip_tags($text); $excerpt_length = 50; // max number of words $words = explode(‘ ‘, $text, $excerpt_length + 1); array_pop($words); array_push($words, ‘-N’); $text = implode(‘ ‘, $words); return $text; } In your loops: echo myExcerpt ( get_the_content() );
I don’t see any hook available to do so. As you are using Child theming, it would be best for you to take a copy of the header.php in the child theme folder and edit it as per your need.
I’d use a filter. You can remove this: if (function_exists(‘bf_new_defaults’)) { return bf_new_defaults( $default_settings ); } else { return $default_settings; } and replace it with something like this: return apply_filters(‘bf_filter’, $default_settings) The following is a truncated, proof of concept version of the code so you can see how $default_settings gets altered. add_filter( ‘bf_filter’, function($default_settings) { … Read more