skip to Main Content

I want to edit the URL to a specific URL as I can’t find the user meta in WordPress nor in the phpMyAdmin in the cPanel.

I want to change this:

if(get_user_meta( $user_id, 'googleplus', $single) !=""){
  echo "<br/><a class='author-link g' title='Follow on Google+' href=".get_user_meta( $user_id, googleplus', $single )." target='_blank'>Google+</a>";
  }

To:

if(get_user_meta( $user_id, 'googleplus', $single) !=""){
  echo "<br/><a class='author-link g' title='Follow on Google+' href="https://example.com" target='_blank'>Google+</a>";
  }

And the error is:

syntax error, unexpected 'https' (T_STRING), expecting ',' or ';'

I have tried:

href="<?php echo "http://www.example.com"; ?>"
href="https://www.example.com"
href="https://www.example.com"

Would appreciate any advice as I have zero knowledge in PHP.

2

Answers


  1. change

     echo "<br/><a class='author-link g' title='Follow on Google+' href="https://example.com" target='_blank'>Google+</a>";
    

    to

     echo '<br/><a class="author-link g" title="Follow on Google+" href="https://example.com" target="_blank">Google+</a>';
    
    Login or Signup to reply.
  2. You have an error in using single quoted and double quoted
    in your code
    change “example.com” to ‘example.com’
    OR use it like this way “example.com” to escape double quoted

    The finnal right code will be

    if(get_user_meta( $user_id, 'googleplus', $single) !=""){
      echo "<br/><a class='author-link g' title='Follow on Google+' href='https://example.com' target='_blank'>Google+</a>";
      }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search