Need help? Check out our Support site, then


Get domain name from URL

  1. Hello!

    I have a wordpress page where I use custom post fields for each post containing details of the post
    (one of them is URL of the source).

    I call the values to the frontpage with the following code:
    <?php $key = "povezava"; echo get_meta($key); ?>

    I would like to get only domain from this whole URL and put the whole URL in the link.

    Example: http://www.google.com/blablabla/link215616.html would be shown as google.com and on click you would be dirrected to http://www.google.com/blablabla/link215616.html.

    I was looking a lot on the web and trying lots of stuff but I'm not so experienced with PHP and I have problems to figure it out.

    any suggestions?

  2. You did not specify a blog address or reason for posting when you created this topic.

    This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you'll find help at the WordPress.org forums.

    If you don't understand the difference between WordPress.com and WordPress.org, you may find this information helpful.

    If you forgot to include a link to your blog, you can reply and include it below. It'll help people to answer your question.

    This is an automated message.

  3. I was looking a lot on the web and trying lots of stuff but I'm not so experienced with PHP and I have problems to figure it out.
    any suggestions?

    Yes. This is the support forum that's only for free hosted WordPress.com blogs and we cannot access the files for the underlying PHP or edit themes - only those with WordPress.ORG installs can do that. You are posting to the worn support forum and need to post to http://wordpress.org/support/

  4. yes i figured that out and already post it on the right forum.. thanks :)

  5. Best wishes for a quick answer. :)

Topic Closed

This topic has been closed to new replies.

About this Topic