Answers for "show all parent pages in wordpress"

PHP
1

get parent page link wordpress

<?php global $post;
  if ( $post->post_parent ) { ?>
    <a href="<?php echo get_permalink( $post->post_parent ); ?>" >
    <?php echo get_the_title( $post->post_parent ); ?>
    </a>
<?php } ?>
Posted by: Guest on May-11-2020
0

wordpress show only parent category

$args = array(
  'orderby' => 'name',
  'order' => 'ASC',
  'parent' => 0
);
$categories = get_categories($args);
Posted by: Guest on April-24-2020

Code answers related to "show all parent pages in wordpress"

Browse Popular Code Answers by Language