WordPress.org

Ready to get started?Download WordPress

Forums

get_permalink returning odd results (3 posts)

  1. Steve
    Member
    Posted 4 years ago #

    I'd assumed get_permalink(post_id) returned the full canonical link for the post but I've got a user using some of my code and its failing because get_permalink(post_id) is only returning a relative url (i.e its missing the http://domain.name.here) part.

    Is this a configuration issue? I'm wondering if he's managed to screw something up in the permalink settings.

  2. uwiuw
    Member
    Posted 4 years ago #

    i don't know why it should be happening. But there are many ways to fix it easily.

    in your theme, you can use this in head (usually named 'header.php' in theme)
    <base href="http://domain.name" />

    base

  3. keesiemeijer
    moderator
    Posted 4 years ago #

    Deactivate all plugins and see if it lists the correct urls

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags