Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

Get the Post Categories From Outside the Loop


<?php
$post = get_post();
if ( $post ) {
    $categories = get_the_category( $post->ID );
    var_dump( $categories );
}
Source by developer.wordpress.org #
 
PREVIOUS NEXT
Tagged: #Get #Post #Categories #From #Outside #Loop
ADD COMMENT
Topic
Name
7+1 =