I am using a WordPress 4.4 in my homepage I show all posts in grids and inside posts ,I placed around 3 to 5 links <a>
.
The thing is I want to show count of all the sub-links which is inside posts in the homepage.
I tried using the following code, but it fetches only attachments but mine is links. Please help me with it.
<?php
$attachments = get_children(array('post_parent'=>$post->ID));
$nbImg = count($attachments);
echo $nbImg.' Files';
?>
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire