Wordpress: One line of php. Can anyone help?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hausarzt
    Confirmed User
    • Jan 2011
    • 818

    #1

    Tech Wordpress: One line of php. Can anyone help?

    Hey guys.
    I recently bought a Wordpress theme from a couple of guys who do not have such a good reputation here in the forum.
    The support, unfortunately, does not answer, so I'm here to ask if anyone can help with a line php.

    Google says the video-tag for "thumbnailUrl" is missing. This sucks, because the theme is meant for videos.

    This is the code on the theme:
    Code:
    <meta itemprop="thumbnailUrl" content="<?php echo $thumb; ?>" />
    This is the output on my site:
    Code:
    <meta itemprop="thumbnailUrl" content="" />
    Yepp, I have added a featured image/thumbnail to each post, but somehow there is no output. So i guess, there is a small glitch in the php code.
    I tried several codes, to get at least something.
    Example:
    Code:
    <meta itemprop="thumbnailUrl" content="<?php echo $get_the_post_thumbnail_url; ?>" />
    
    <meta itemprop="thumbnailUrl" content="<?php echo the_post_thumbnail_url; ?>" />
    I even tried this, just for a test, if anything comes up:
    Code:
    <meta itemprop="thumbnailUrl" content="<?php echo $title; ?>" />
    And, voila, I get the title of the post. So basically the meta itemprop="thumbnailUrl" content=" is correct, only the php-part is not.

    Solution?
    I know, my english is bad. But your german might be even worse
  • Paul&John
    Confirmed User
    • Aug 2005
    • 8644

    #2
    I'm going offline now but get_the_post_thumbnail_url and the_post_thumbnail_url are functions so you call them like this
    Code:
    <?php get_the_post_thumbnail_url(); ?>
    <?php the_post_thumbnail_url(); ?>
    Check the WP reference for usage (image size etc):
    https://developer.wordpress.org/refe...thumbnail_url/
    https://developer.wordpress.org/refe...thumbnail_url/
    Use coupon 'pauljohn' for a $1 discount at already super cheap NameSilo!
    Anal Webcams | Kinky Trans Cams Live | Hotwife XXX Tube | Get your Proxies here

    Comment

    • hausarzt
      Confirmed User
      • Jan 2011
      • 818

      #3
      Originally posted by Paul&John
      I'm going offline now but get_the_post_thumbnail_url and the_post_thumbnail_url are functions so you call them like this
      Code:
      <?php get_the_post_thumbnail_url(); ?>
      <?php the_post_thumbnail_url(); ?>
      Check the WP reference for usage (image size etc):
      https://developer.wordpress.org/refe...thumbnail_url/
      https://developer.wordpress.org/refe...thumbnail_url/
      Yepp, already tried both. No success.
      I know, my english is bad. But your german might be even worse

      Comment

      • awxm
        Confirmed User
        • Aug 2009
        • 819

        #4
        I had a similar problem recently. Does the theme use custom fields for images rather than native wordpress featured images perhaps?

        *edit*
        If you are talking about a WP-Script theme, copy the featured image url to "Main thumbnail" block and update post.
        .

        Comment

        • Kittens
          👏 REVOLUTIONARY 👏
          • Jan 2016
          • 1440

          #5
          Originally posted by hausarzt
          Wordpress: One line of php. Can anyone help?
          Delete wordpress.

          Comment

          • blackmonsters
            Making PHP work
            • Nov 2002
            • 20984

            #6
            <meta itemprop="thumbnailUrl" content="<?php echo get_the_post_thumbnail_url(); ?>" />

            <meta itemprop="thumbnailUrl" content="<?php the_post_thumbnail_url(); ?>" />



            Your neighbor will murder you with frogs
            Click here

            Comment

            • hausarzt
              Confirmed User
              • Jan 2011
              • 818

              #7
              Originally posted by awxm
              I had a similar problem recently. Does the theme use custom fields for images rather than native wordpress featured images perhaps?

              *edit*
              If you are talking about a WP-Script theme, copy the featured image url to "Main thumbnail" block and update post.
              That did the trick
              I know, my english is bad. But your german might be even worse

              Comment

              • j3rkules
                VIP
                • Jul 2013
                • 22111

                #8
                Originally posted by hausarzt
                That did the trick

                Comment

                Working...