-1

I have created a shortcode to add social buttons on the frontend from a custom dynamic field. the shortcode is working fine but i need to the dynamic url to 'href' within the shortcode i have created.

I am sure i am missing something, since i have little knowledge of php. This is the code:

// Add Shortcode
function custom_shortcode() {

          $facebookURL == get_option( 'facebook-link-value' );

  return '<a class="btn btn-sm btn-primary border-0 my-1 bg-facebook min-w-35" href="'.$facebookURL.'" role="button"><i class="fab fa-facebook-f"></i></a>';

}
add_shortcode( 'social_links', 'custom_shortcode' );
Nash
  • 285
  • 2
  • 15

1 Answers1

-1

just replaced == with =

// Add Shortcode
function custom_shortcode() {

          $facebookURL = get_option( 'facebook-link-value' );

  return '<a class="btn btn-sm btn-primary border-0 my-1 bg-facebook min-w-35" href="'.$facebookURL.'" role="button"><i class="fab fa-facebook-f"></i></a>';

}
add_shortcode( 'social_links', 'custom_shortcode' );
Nash
  • 285
  • 2
  • 15