Fetch and add data to MySql
Your code is mostly all right, especially given it's your first code attempt. 

I would say there is only on critical flaw. A post or a category is not a database connection. Hence it should be never extended from it. It would be like if you extend a human from a car simply because a human is going to ride a car. A car is a service used by a human, that needs to be injected into a human object. 

Besides, the way your code is written, it will create a new connection to the database in the  every class instance. Which will result in the "Too many connections"  error. 

To sum it up: 


a database connection has to be made only once. and then passed as a parameter to all your classes that need it. 
your dbh class is rather useless. it does't add anything to original PDO. so you can get rid of it and simply create a plain PHP file with connection code and include it in your scripts
then you have to rewrite your data classes adding a constructor, providing either vanilla PDO or your own database connection class' instance as a parameter


something like this

class categoriesData {
    protected $conn;
    public function __construct($conn) {
        $this-&gt;conn = $conn;
    }
    ...


and then use it like this

require_once 'pdo.php';
$post = new PostsData($pdo);
$posts = $post-&gt;getPosts();

foreach ($posts as $post) { 
    echo $post-&gt;post_title . '&lt;br&gt;';
}