Why post__not_in is ignored?

As per the Codex entry: “post__not_in (array) – use post ids. Specify post NOT to retrieve. If this is used in the same query as post__in, it will be ignored.“ Try to make an array of the post id’s you do want to display, OR an array of the post id’s you want to exclude … Read more

My custom template page not loading content inside it?

you have to use the WP Loop to get page content. Try this <?php /* Template Name: home */ get_header(); ?> <div id=”theme-main-banner” class=”banner-three gradient-banner-three”> <?php while(have_posts()): the_post(); ?> <?php the_content(); ?> <?php endwhile; ?> </div> <?php get_footer(); ?> UPDATE The issue was that front-page.php was already present in the theme. So as per the … Read more

IF user is logged in only show certain page

Big Question. So, first, to keep the galleries separate, it would be good to give them their own custom post type. We’ll be checking for this later… <?php add_action( ‘init’, ‘wpse32840_register_post_type’ ); function wpse32840_register_post_type() { register_post_type( ‘client_gallery’, array( ‘label’ => __( ‘Client Galleries’ ), // probably needs better lables ‘public’ => true, // allow people … Read more

Does is_child() exist in wp 3.5.1?

To check for a specific parent ID use $post->post_parent==”123″ and replace “123” with the parent ID of your choice. I learned how to do this by using the Widget Logic plugin. From the Widget Logic notes: global $post; return (is_page(‘pagename’) || ($post->post_parent==”13″)); — home page OR the page that’s a child of page 13 Edit: … Read more

External stylesheet per page

This approach (one general css) will make your first-load times longer, but when you browse other pages, if the css is cached, everything will be faster. If you make your stylesheet smaller by splitting them up.. you might have a ‘slightly faster’ first-page load but every other page that uses another css will still be … Read more

Why does not this wp_redirect work in is_single()?

is_singular() only accept post_type, use is_single(‘2024’) for specific post. if (is_single(2024)) { wp_redirect(‘http://mysitedomain.com/../rugby/’); exit(); } Update: Also wp_redirect() does not work after headers are sent. Please make sure you are redirecting before headers. So you can hook this function on template_redirect and put this in functions.php function redirect_custom_page() { if (is_single(‘2024’)) { wp_redirect(‘http://mysitedomain.com/../rugby/’); exit(); } … Read more

Suddenly forbidden 403 error on some pages

Please check the permissions of files and folders. All folders should have permission set to 755 and files should have 644 . If permissions are different than specified, please try changing the permissions. You can easily check and change permissions using filezilla. Let me know if it helps.

Add menu page issues (permissions & position)

you can do something like: // create your own page add_menu_page(‘my-page’, ‘My Page’, ‘My Page’, ‘parent-slug’, ‘my_plugin_options’, ”, ’10’); // create the subpage under my-page add_submenu_page(‘parent-slug’, ‘Sidebars’, ‘Sidebars’, ‘manage_options’, __FILE__, array(‘sidebar_generator’,’admin_page’)); Note that the last parameter on add_menu_page is a 10. The higher the number the lower the position of the menu item. HTH