• Hi,

    I want to get the permalink from a given variable.

    I have an option using the settings api in which users can input the slug of a page.

    What i wanted is to output the permalink of the slug inputted by users.

    I have this,

    function mytheme_option( $option ) {
    	$options = get_option( 'mytheme_options' );
    	if ( isset( $options[$option] ) )
    		return $options[$option];
    	else
    		return false;
    }
    $termspage = mytheme_option('terms_slug');
    echo get_permalink($termspage);

    However, it doesn’t output the permalink even the page of the inputted slug exists.

    Please help

  • The topic ‘Getting the permalink from a variable.’ is closed to new replies.