Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Formatting, grammar, tags
Source Link
Dave Romsey
  • 17.9k
  • 11
  • 55
  • 70

I was wondering if someone could help me out. I have used this function:

function add_taxonomies_to_pages() {

 register_taxonomy_for_object_type( 'category', 'page' );
 }
add_action( 'init', 'add_taxonomies_to_pages' );
 if ( ! is_admin() ) {
 add_action( 'pre_get_posts', 'category_and_tag_archives' );
 
 }
function category_and_tag_archives( $wp_query ) {
$my_post_array = array('post','page');
 
 if ( $wp_query->get( 'category_name' ) || $wp_query->get( 'cat' ) )
 $wp_query->set( 'post_type', $my_post_array );
 

}

to addIt adds categories to my wordpressWordPress pages, but the category archive pages wontwon't display. I have a category called Association Landing PagesAssociation Landing Pages with the slug association-landing-pagesassociation-landing-pages. iI am developing locally. so when iWhen I go to localhost/mywordpressitefolder/association-landing-page ilocalhost/mywordpressitefolder/association-landing-page I am getting a page/file not found error.

I was wondering if someone could help me out. I have used this function:

function add_taxonomies_to_pages() {

 register_taxonomy_for_object_type( 'category', 'page' );
 }
add_action( 'init', 'add_taxonomies_to_pages' );
 if ( ! is_admin() ) {
 add_action( 'pre_get_posts', 'category_and_tag_archives' );
 
 }
function category_and_tag_archives( $wp_query ) {
$my_post_array = array('post','page');
 
 if ( $wp_query->get( 'category_name' ) || $wp_query->get( 'cat' ) )
 $wp_query->set( 'post_type', $my_post_array );
 

}

to add categories to my wordpress pages but the category archive pages wont display. I have a category called Association Landing Pages with the slug association-landing-pages. i am developing locally. so when i go to localhost/mywordpressitefolder/association-landing-page i am getting a page/file not found error.

I was wondering if someone could help me out. I have used this function:

function add_taxonomies_to_pages() {

 register_taxonomy_for_object_type( 'category', 'page' );
 }
add_action( 'init', 'add_taxonomies_to_pages' );
 if ( ! is_admin() ) {
 add_action( 'pre_get_posts', 'category_and_tag_archives' );
 
 }
function category_and_tag_archives( $wp_query ) {
$my_post_array = array('post','page');
 
 if ( $wp_query->get( 'category_name' ) || $wp_query->get( 'cat' ) )
 $wp_query->set( 'post_type', $my_post_array );
 

}

It adds categories to my WordPress pages, but the category archive pages won't display. I have a category called Association Landing Pages with the slug association-landing-pages. I am developing locally. When I go to localhost/mywordpressitefolder/association-landing-page I am getting a page/file not found error.

deleted 1 character in body
Source Link
steamfunk
  • 645
  • 3
  • 13
  • 26

I was wondering if someone could help me out. I have used this function:

function add_taxonomies_to_pages() {

 register_taxonomy_for_object_type( 'category', 'page' );
 }
add_action( 'init', 'add_taxonomies_to_pages' );
 if ( ! is_admin() ) {
 add_action( 'pre_get_posts', 'category_and_tag_archives' );
 
 }
function category_and_tag_archives( $wp_query ) {
$my_post_array = array('post','page');
 
 if ( $wp_query->get( 'category_name' ) || $wp_query->get( 'cat' ) )
 $wp_query->set( 'post_type', $my_post_array );
 

}

to add categories to my wordpress pages but the category archive pages wont display. I have a category called Association Landing Pages with the slug association-landing-pages. i am developing locally. so when i go to localhost/mywordpressitefolder/association-landing-page i am getting a page/file not found error. I

I was wondering if someone could help me out. I have used this function:

function add_taxonomies_to_pages() {

 register_taxonomy_for_object_type( 'category', 'page' );
 }
add_action( 'init', 'add_taxonomies_to_pages' );
 if ( ! is_admin() ) {
 add_action( 'pre_get_posts', 'category_and_tag_archives' );
 
 }
function category_and_tag_archives( $wp_query ) {
$my_post_array = array('post','page');
 
 if ( $wp_query->get( 'category_name' ) || $wp_query->get( 'cat' ) )
 $wp_query->set( 'post_type', $my_post_array );
 

}

to add categories to my wordpress pages but the category archive pages wont display. I have a category called Association Landing Pages with the slug association-landing-pages. i am developing locally. so when i go to localhost/mywordpressitefolder/association-landing-page i am getting a page/file not found error. I

I was wondering if someone could help me out. I have used this function:

function add_taxonomies_to_pages() {

 register_taxonomy_for_object_type( 'category', 'page' );
 }
add_action( 'init', 'add_taxonomies_to_pages' );
 if ( ! is_admin() ) {
 add_action( 'pre_get_posts', 'category_and_tag_archives' );
 
 }
function category_and_tag_archives( $wp_query ) {
$my_post_array = array('post','page');
 
 if ( $wp_query->get( 'category_name' ) || $wp_query->get( 'cat' ) )
 $wp_query->set( 'post_type', $my_post_array );
 

}

to add categories to my wordpress pages but the category archive pages wont display. I have a category called Association Landing Pages with the slug association-landing-pages. i am developing locally. so when i go to localhost/mywordpressitefolder/association-landing-page i am getting a page/file not found error.

Source Link
steamfunk
  • 645
  • 3
  • 13
  • 26

Category Archive not working for pages

I was wondering if someone could help me out. I have used this function:

function add_taxonomies_to_pages() {

 register_taxonomy_for_object_type( 'category', 'page' );
 }
add_action( 'init', 'add_taxonomies_to_pages' );
 if ( ! is_admin() ) {
 add_action( 'pre_get_posts', 'category_and_tag_archives' );
 
 }
function category_and_tag_archives( $wp_query ) {
$my_post_array = array('post','page');
 
 if ( $wp_query->get( 'category_name' ) || $wp_query->get( 'cat' ) )
 $wp_query->set( 'post_type', $my_post_array );
 

}

to add categories to my wordpress pages but the category archive pages wont display. I have a category called Association Landing Pages with the slug association-landing-pages. i am developing locally. so when i go to localhost/mywordpressitefolder/association-landing-page i am getting a page/file not found error. I