Question: I have two custom post types…

BOOK and BOOK AUTHOR.

I want to…

LIST all BOOK's by an author on their respective AUTHOR PAGE.

So if i have 10 books by Stephen KING. I want to list them all (and only those by him) on the STEPHEN KING page. I am having real trouble working out how to query posts to do this.

Any advice? I am using advanced custom fields plugin if that helps, but can't work out how to query and display this post information.

I currently use the following code to display ALL of my releases, but how do i get the specific ones on their specific author pages?

```
<?php
     $args=array(
     'post_type' => 'book',
     'post_status' => 'publish',
     'posts_per_page' => 12,
     'caller_get_posts'=> 1,
     'orderby'=> 'date',
     'order' => 'DESC'
     );
     $my_query = null;
     $my_query = new WP_Query($args);
     if( $my_query->have_posts() ) {
     echo '';
     $i = 0;
     while ($my_query->have_posts()) : $my_query->the_post();
     if($i % 6 == 0) { ?>
<div class="row">    
<?php
}
?>

<img src="<?php the_field('cover_image'); ?>" /><br />
<?php the_field('author_name'); ?><br />
<?php the_title(); ?><br />

</div>

<?php    
if($i % 6 == 0) { ?> 

<?php
}

$i++;
endwhile;
 } 
wp_reset_query();
?>

```

Answer: 
ng-bind-html-unsafe has been removed from the current version (1.2+) of angular. I would recommend using the $sanitize service in the new version of angular. You'll need to include the sanitize library and add it to your module.

That way you can do whatever you want once the sanitize operation is complete and not worry about a callback.

A quick and dirty implementation:

```
<!doctype html>
<html lang="en">
<head>
  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.11/angular.js"></script>
  <script src="libs/angular/angular-sanitize.js"></script>
</head>
<body ng-app="myApp">
  <div ng-controller="myController">
    <div>{{sanitized}}</div>
  </div>
  <script>
    angular.module('myApp', ['ngSanitize'])
      .controller('myController', ['$scope', '$sanitize', function($scope, $sanitize) {
        $scope.sanitized = $sanitize('someTextFromSomeSource');
        // Do whatever you want here with the cleaned up text
      }])
  </script>
</body>
</html> 

```
I would move the html in your demo to a `directive`:

```
<div ng-bind-html-unsafe="whatever"></div>

```

in the directive I would manipulate the html based on my needs, I am here basing this on an assumption since I am not sure how often or how `whatever` variable is being updated so the generic solution will be a `$watch` listener over this variable like this:

```
$scope.$watch('whatever',function(newValue,oldValue, scope){
     //do something
});

```

All this code in my new directive, probably you will want to use the `postLink` function

Here is [the Documentation from Angular](http://docs.angularjs.org/api/ng.%24compile) about this.

> 
> Post-linking function
>  Executed after the child elements are linked. It is safe to do DOM transformation in the post-linking function.
> 
> 
>