Get taxonomy that is attached to post with all its parents

You want get_ancestors(). This is pretty crude but… $locations = get_the_terms( $post->ID, ‘category’ ); // var_dump($locations); $pat=”<a href=””.site_url().’/location/%s”>%s</a>’; foreach ( $locations as $location ) { printf($pat,$location->slug,$location->name); $anc = get_ancestors($location->term_id,’category’); if (!empty($anc)) { foreach ($anc as $term) { $t = get_term_by( ‘term_id’, $term, ‘category’); printf($pat,$t->slug,$t->name); } } break; }

Show page name after home url

When creating your custom post type set with_front to false in the rewrite. ‘rewrite’ => array( ‘slug’ => ‘campaigns’, ‘with_front’ => false, )

How to get the real thumbnail size?

wp_get_attachment_metadata – Retrieve attachment meta field for attachment ID. $image_meta = wp_get_attachment_metadata( $attachment_id, $unfiltered ); As you can see, the width x height is nested in sizes for each size. Array ( [width] => 2400 [height] => 1559 [file] => 2011/12/press_image.jpg [sizes] => Array ( [thumbnail] => Array ( [file] => press_image-150×150.jpg [width] => 150 … Read more