• nicoter

    (@nicoter)


    Hi,

    Can you add auto detection of the author also for pages?

    I did it by adding is_page() to the conditional statement in meks-smart-author-widget-template.php. Previous:

    if($instance['auto_detect']){
    	if(is_author()){
    		$obj = get_queried_object();
    		$user_id = $obj->data->ID;
    	} elseif(is_single()){
    		$obj = get_queried_object();
    		$user_id = $obj->post_author;
    	}
    }

    Changed to:

    if($instance['auto_detect']){
    	if(is_author()){
    		$obj = get_queried_object();
    		$user_id = $obj->data->ID;
    	} elseif(is_single() || is_page()){
    		$obj = get_queried_object();
    		$user_id = $obj->post_author;
    	}
    }

    Now I’d prefer an update proof solution and would appreciate, if you can add auto detect support for pages.

    Thanks

  • The topic ‘Author auto detect support for pages’ is closed to new replies.