• Resolved SpencerTS

    (@spencerts)


    I am currently working on a project which requires me to distinguish between posts created through Organized Docs and posts that are created for the blog (preferably with some sort of PHP function). Is there an easy way to do this? Currently, I am finding out whether the current page is part of the blog by using is_home() and is_single(), I just need a way to tell that the current page is only part of the blog and not part of organized docs.

    Thanks,
    Spencer

    https://wordpress.org/plugins/organized-docs/

Viewing 1 replies (of 1 total)
  • Plugin Author isabel104

    (@isabel104)

    This function will determine if you’re on an Organized Docs page. It will return TRUE if you’re on any of the single Docs pages, or on a Docs category or Docs taxonomy page.

    /**
     * Determine if the current page belongs to the Organized Docs plugin.
     *
     * @return bool 	Returns TRUE on single docs, docs category, and docs taxonomy pages, otherwise return FALSE.
     */
    function is_organized_docs_page() {
    	if ( is_tax( 'isa_docs_category' ) || is_post_type_archive( 'isa_docs' ) || is_singular( 'isa_docs' ) ) {
    		return true;
    	} else {
    		return false;
    	}
    }

    To check if you’re on any page that’s NOT an Organized Docs page, use it like this:

    // Check if you're on any page that's NOT an Organized Docs page
    
    if ( ! is_organized_docs_page() ) {
    
    	// This iS NOT an Organized Docs page
    
    }

    Sorry for the delay. Hope that helps.

Viewing 1 replies (of 1 total)
  • The topic ‘Distinguishing between organized docs posts and regular posts’ is closed to new replies.