Hot answers tagged

3

I finally got it working, but not with the code in my question. I totally scrapped that whole idea and restarted going in a new direction. NOTE: If anyone are ever able to sort out the issues in my question, feel free to post an answer. Also, if you have any other solution, also feel free to post an answer. REWORKED CLASS AND SOLUTION: What I tried to do ...


2

Try this: if ( is_front_page() && is_home() ) { // Default homepage } elseif ( is_front_page() ) { // static homepage } elseif ( is_home() ) { // blog page } else { //everything else } Source: http://codex.wordpress.org/Conditional_Tags


2

If you want to redirect, a good event to use is template_redirect: add_action( 'template_redirect', 'my_page_template_redirect' ); function my_page_template_redirect() { // You can skip is_user_logged_in() if checking the user capability if( is_page( 1234 ) && ! current_user_can( 'do_something_special' ) ) { $redirect_to = ...


1

OK @Muyassir S. - we are missing some information to understand the problem. We basicly dont know if the "page" you are talking about is a category page, Your home page or a custom page - meaning: which file is being used to show that blog? here are two possible solutions. If we are talking about a category / page with slug: if(is_category('blog')) { ...


1

This sounds like the wrong way around and always having the danger of forgetting or misconfiguring something. If you need content separation, just use a network install. It has a little more overhead of admin but it out of the box ensures the content separation you seek.


1

What a great question. Here is the function: function add_taxonomies_to_pages() { register_taxonomy_for_object_type( 'post_tag', 'page' ); register_taxonomy_for_object_type( 'category', 'page' ); } add_action( 'init', 'add_taxonomies_to_pages' ); Get back to winning, now.


1

Try this: $args = array( 'sort_order' => 'asc', 'sort_column' => 'menu_order', 'hierarchical' => 1, 'parent' => $post->ID ); $pages = get_pages($args);



Only top voted, non community-wiki answers of a minimum length are eligible