0
votes

Is there a way to define a fixed Custom Post Type URL in Wordpress, meaning a URL that would be independent of the permalinks settings of the website?

I am worried that my plugin might not work properly if the default permalinks settings is activated.

1

1 Answers

1
votes

Here:

$permalink null means it's set default permalink.

$permalink = get_option('permalink_structure'); 

if($permalink != "")
{   
    echo "<li><a href='".get_bloginfo('url')."/".ltrim (get_option('resolution_base'),'/')."/wallpapers'>LINK</a></li>";
}else{
    echo "<li><a href='".get_bloginfo('url')."/?".ltrim (get_option('resolution_base'),'/')."wallpapers'>LINK</a></li>";
}