Forum Replies Created

Viewing 5 replies - 346 through 350 (of 350 total)
  • Thread Starter GusRuss89

    (@gusruss89)

    This is the code that creates the custom taxonomy. My guess is that it must be a problem somewhere in here.

    /* Add a new "categories" taxonomy to growers posts */
    add_action( 'init', 'create_grower_taxonomy', 0 );
    function create_grower_taxonomy() {
      // Add new taxonomy, make it hierarchical (like categories)
      $labels = array(
        'name'                => _x( 'Categories', 'taxonomy general name' ),
        'singular_name'       => _x( 'Category', 'taxonomy singular name' ),
        'search_items'        => __( 'Search Categories' ),
        'all_items'           => __( 'All Categories' ),
        'parent_item'         => __( 'Parent Category' ),
        'parent_item_colon'   => __( 'Parent Category:' ),
        'edit_item'           => __( 'Edit Category' ),
        'update_item'         => __( 'Update Category' ),
        'add_new_item'        => __( 'Add New Category' ),
        'new_item_name'       => __( 'New Category Name' ),
        'menu_name'           => __( 'Categories' )
      ); 	
    
      $args = array(
        'hierarchical'        => true,
        'labels'              => $labels,
        'show_ui'             => true,
        'show_admin_column'   => true
        //'query_var'           => true
        //'rewrite'             => array( 'slug' => 'gp_categories' )
      );
    
      register_taxonomy( 'gp_categories', array( 'grower_posts' ), $args );
    }
    Thread Starter GusRuss89

    (@gusruss89)

    Thanks for the reply.

    It’s definitely correct. The template actually works, it’s just that the loop doesn’t work inside it – or it doesn’t think it has any actual posts.

    Thread Starter GusRuss89

    (@gusruss89)

    I found the function responsible. It was a jQuery function added by the original theme (Shelflife by WooThemes) that turns the menu into a select under certain widths.

    I wasn’t using that function anyway, but if anyone feels like debugging it for funsies, here’s the code that was causing the issue.

    https://pastebin.com/FCdpDJkj

    Thread Starter GusRuss89

    (@gusruss89)

    Does anyone have any idea where I should start looking into this problem?

    Thread Starter GusRuss89

    (@gusruss89)

    Here’s the function that includes line 2758 (line 2758 is the line starting with trigger_error).

    /**
     * Marks something as being incorrectly called.
     *
     * There is a hook doing_it_wrong_run that will be called that can be used
     * to get the backtrace up to what file and function called the deprecated
     * function.
     *
     * The current behavior is to trigger a user error if WP_DEBUG is true.
     *
     * @package WordPress
     * @subpackage Debug
     * @since 3.1.0
     * @access private
     *
     * @uses do_action() Calls 'doing_it_wrong_run' and passes the function arguments.
     * @uses apply_filters() Calls 'doing_it_wrong_trigger_error' and expects boolean value of true to do
     *   trigger or false to not trigger error.
     *
     * @param string $function The function that was called.
     * @param string $message A message explaining what has been done incorrectly.
     * @param string $version The version of WordPress where the message was added.
     */
    function _doing_it_wrong( $function, $message, $version ) {
    
    	do_action( 'doing_it_wrong_run', $function, $message, $version );
    
    	// Allow plugin to filter the output error trigger
    	if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) {
    		$version = is_null( $version ) ? '' : sprintf( __( '(This message was added in version %s.)' ), $version );
    		$message .= ' ' . __( 'Please see <a href="https://codex.www.ads-software.com/Debugging_in_WordPress">Debugging in WordPress</a> for more information.' );
    		trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version ) );
    	}
    }
Viewing 5 replies - 346 through 350 (of 350 total)