WordPress.org

Ready to get started?Download WordPress

Forums

JM Twitter Cards
[resolved] Wrong URL parsed into twitter:domain (4 posts)

  1. Metro Fashion Hub
    Member
    Posted 10 months ago #

    The url of the site is http://www.metropolitanfashionhub.com. However the plugin picks up http://www.metropolitanfashionhub.com/wp/ (which is the folder where WP is installed) and uses that url to parse to twitter:domain. Which in turn will give a 404 error to anyone who clicks on it.
    I didn't see anything in the options to specify the correct URL. For the time being I've modified the plugin files and removed the following line:
    echo '<meta property="twitter:domain" content="' . get_bloginfo('wpurl') . '"/>'."\n";

    Is there a better way of fixing this?

    http://wordpress.org/extend/plugins/jm-twitter-cards/

  2. jmlapam
    Member
    Plugin Author

    Posted 10 months ago #

    get_bloginfo('wpurl') returns the "WordPress address (URL)" set in Settings > General. This data is retrieved from the "siteurl" record in the wp_options table.

    This issue is weird but you know bugs happen.
    So to me it would be a better solution to let the original meta remain intact and replace get_bloginfo() with home_url():

    echo '<meta property="twitter:domain" content="' . home_url() . '"/>'."\n";

    Hope this will help. Just tell me :)

  3. superterrific
    Member
    Posted 10 months ago #

    Hi, I was also having this issue and making your suggested change on line 267 in jm-twitter-cards.php worked for me, many thanks!

    To anyone else trying this, making the change on line 220 will not fix the issue.

    I'm hoping that this issue can be addressed in an upcoming update so I don't have to remember to come back and update that line of code.

    Thanks for the fix and the handy plug-in JM!

  4. jmlapam
    Member
    Plugin Author

    Posted 10 months ago #

    Ok cool, this will be updated, probably with get_bloginfo('url')

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.