Support » Plugin: Content Aware Sidebars - Unlimited Widget Areas » Unable to recognize content by co-authors plus guest authors

  • Resolved zwrodgers

    (@zwrodgers)


    I’m unable to get the plugin to recognize guest authors (using the coauthors plus plugin). Any idea why this is happening?

    More info:
    I set specific sidebars to appear according to whom the guest author is and set it to show on singular posts. Nothing seems to work.

    My work around is to simply tag each post by the guest author, but that can get tedious.

    Any suggestions would be greatly appreciated!

    http://wordpress.org/extend/plugins/content-aware-sidebars/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Joachim Jensen

    (@intoxstudio)

    Thanks for your feedback. The plugin currently does not support the mentioned plugin – it stores the co authors in a different place and Content Aware Sidebars does not recognize these.

    I might add official support sometime, but right now it can be solved by adding a hook in your theme functions. I will provide the code in this thread as soon as I get time to look into it.

    Plugin Author Joachim Jensen

    (@intoxstudio)

    Try to insert this code in functions.php of your theme:

    add_filter("cas-db-where-authors", "cas_coauthors_filter");
    
    	function cas_coauthors_filter($where) {
    		global $post;
    		$author = (string)(is_singular() ? $post->post_author : get_query_var('author'));
    		$coauthors = coauthors_IDs($between = "','", null, null, null, false );
    		return "(authors.meta_value IS NULL OR authors.meta_value IN('authors','".$author."','".$coauthors."'))";
    	}

    It has not been tested so please give me feedback on it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Unable to recognize content by co-authors plus guest authors’ is closed to new replies.