get_permalink() getting the wrong permalink structure

[ad_1] [https://imgur.com/a/veeuojm])

I’ve got my settings set to `Category – Post Title` which is what is used on other sites I’ve used/created before but my homepage url is being printed as “[siteurl.com/uncategorized/28/]”.

this page has been indicated as the homepage so it should print the root url although it’s just not.

​

EDIT:

Here’s the PHP code I’m using to output the menu items:

global $post;
$location = ‘menu’;
$nav = wp_get_nav_menu_items( $location );
$output = ‘<ul>’;
$template = file_get_contents( $arttastic->get( ‘theme_dir’ ) . ‘/components/menu/templates/item.html’ );

foreach ( $nav as $item ) {

$icon = $arttastic->get( ‘arttastic_icon_selector’, $item->ID );
$text = $item->title;
$url = get_permalink( $item->ID );
$active = $url === $_SERVER[‘SERVER_URI’] ? ‘active’
: ”;

$replace_pairs = array(
‘{{active}}’ => $active,
‘{{url}}’ => $url,
‘{{text}}’ => $text,
‘{{icon}}’ => $icon[‘value’] );

$output .= strtr( $template, $replace_pairs );
}

return $output . ‘</ul>’;

&#x200B;

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer