0

I have a custom taxonomy (lesson) that helps divide posts and other custom post types between different views over the data. Now I have the custom taxonomy page expanded and visible.

http://www.ascuoladiopencoesione.it/lesson/1-progettare/

You should see an empty page, and that is the issue: Only registered users appear to be able to see the content, and that is strange, because the configuration does not do anything to enforce that...

Thanks

EDIT

This is the structure for the Custom Taxonomy. The custom post type is portfolio_entry, in a theme (enfold)... for other taxonomies and stuff there is no problem, only this doesn't work...

function lessons() {

$labels = array(
    'name'                       => _x( 'Lessons', 'Taxonomy General Name', 'text_domain' ),
    'singular_name'              => _x( 'Lesson', 'Taxonomy Singular Name', 'text_domain' ),
    'menu_name'                  => __( 'Lesson', 'text_domain' ),
    'all_items'                  => __( 'All Lesson Lessons', 'text_domain' ),
    'parent_item'                => __( '', 'text_domain' ),
    'parent_item_colon'          => __( '', 'text_domain' ),
    'new_item_name'              => __( 'New Lesson', 'text_domain' ),
    'add_new_item'               => __( 'Add new Lesson', 'text_domain' ),
    'edit_item'                  => __( 'Edit Lesson', 'text_domain' ),
    'update_item'                => __( 'Update Lesson', 'text_domain' ),
    'separate_items_with_commas' => __( 'Separate Lessons with commas', 'text_domain' ),
    'search_items'               => __( 'Search Lessons', 'text_domain' ),
    'add_or_remove_items'        => __( 'Add or remove Lessons', 'text_domain' ),
    'choose_from_most_used'      => __( 'Choose from the most used Lessons', 'text_domain' ),
    'not_found'                  => __( 'Not Found', 'text_domain' ),
);
$args = array(
    'labels'                     => $labels,
    'hierarchical'               => true,
    'public'                     => true,
    'show_ui'                    => true,
    'show_admin_column'          => true,
    'has_archive'                => true,
    'show_in_nav_menus'          => true,
    'show_tagcloud'              => true
);
register_taxonomy( 'lesson', array( 'post','portfolio','link_category', 'forum', "topic" ), $args );

}

// Hook into the 'init' action
add_action( 'init', 'lessons', 0 );

EDIT added plugins

  • bbPress
  • Black Studio TinyMCE Widget
  • Duplicate Post
  • Google Analytics for WordPress
  • MailChimp for WordPress Lite
  • Page Builder by SiteOrigin
  • Responsive Add Ons
  • Simple History
  • User Role Editor
  • User Tags for Wordpress
  • Widget Customizer
  • WordPress Social Login
  • WP Project Manager
  • Newsletters Wysija

EDIT - how do I get the posts

$args = array(
    'posts_per_page'   => -1,
    'offset'           => 0,
    'lesson'           => $wp_query->queried_object->name,
    'orderby'          => 'post_date',
    'order'            => 'DESC',
    'post_type'        => array('post', 'portfolio', 'forum', 'link', 'topic', 'link_category'),
    'post_status'      => 'publish',
    'suppress_filters' => true ); 
$myposts = get_posts( $args );
foreach ( $myposts as $post ) : setup_postdata( $post );
6
  • Can you show us the code how you've registered the post type and taxonomy?
    – Horttcore
    Commented Nov 24, 2014 at 20:07
  • I have added the details on how I instantiate the taxonomy... Commented Nov 25, 2014 at 15:52
  • Are you certain that there are no plugins causing this issue? Could you edit your question and list the plugins you have installed? Can you disable all your plugins to see if that changes the situation?
    – Howdy_McGee
    Commented Nov 25, 2014 at 15:55
  • Where do you call this function?
    – Horttcore
    Commented Nov 25, 2014 at 15:57
  • @Howdy_McGee I cannot disable them, but I'll add the list. Commented Nov 25, 2014 at 17:25

1 Answer 1

0

I do not in the world know why this works. Yet it does. For future reference...

function remove_meta( $query ) {
    $query->set( 'meta_query', false );
}
add_action( 'pre_get_posts', 'remove_meta' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.