Sitemap

[insert_php]
$args = array(
‘posts_per_page’ => -1
);

$query = new WP_Query($args);
$q = array();

while ( $query->have_posts() ) {

$query->the_post();

$a = ‘‘ . get_the_title() .’‘;

$categories = get_the_category();

foreach ( $categories as $key=>$category ) {

$b = ‘

‘ . $category->name . ‘

‘;

}

$q[$b][] = $a; // Create an array with the category names and post titles
}

/* Restore original Post Data */
wp_reset_postdata();

foreach ($q as $key=>$values) {
echo $key;

echo ‘

    ‘;
    foreach ($values as $value){
    echo ‘

  • ‘ . $value . ‘
  • ‘;
    }
    echo ‘

‘;
}
[/insert_php]

provides you with all the tools to generate actionable insights, both desktop as mobile.“
- Paul