Skip to main content
added 889 characters in body
Source Link
Jacob Peattie
  • 43.9k
  • 10
  • 49
  • 62

You haven't included get_header() or get_footer() in your template. They will load header.php and footer.php which should include wp_head() and wp_footer(). Those last two functions are important because that's where scripts are loaded.

WhatIf your shortcode depends on a script being loaded in the header or the footer, then you have isn't including any scriptsneed wp_head() or CSSwp_footer(), thats where plugins load their scripts. Looking at the code for this plugin (tell me if that's not it), then the script for it loads in wp_head().

So at the very least your template needs to look like this:

<?php 
/*
Template Name: Social Login Page
*/
?>
<!DOCTYPE html>
<html>
<head>
    <?php wp_head(); ?>
</head>
<body>
    <?php echo do_shortcode('[wordpress_social_login]'); ?>
</body>
</html>

Looking at the plugin code, the only way it could've worked on your localhost is is you had not turned on the "popup" functionality, which requires the script.

Also, even if you're not using wp_head(), you still need the <html>,<head>, and <body> tags to be valid HTML.

You haven't included get_header() or get_footer() in your template. They will load header.php and footer.php which should include wp_head() and wp_footer(). Those last two functions are important because that's where scripts are loaded.

What you have isn't including any scripts or CSS.

You haven't included get_header() or get_footer() in your template. They will load header.php and footer.php which should include wp_head() and wp_footer(). Those last two functions are important because that's where scripts are loaded.

If your shortcode depends on a script being loaded in the header or the footer, then you need wp_head() or wp_footer(), thats where plugins load their scripts. Looking at the code for this plugin (tell me if that's not it), then the script for it loads in wp_head().

So at the very least your template needs to look like this:

<?php 
/*
Template Name: Social Login Page
*/
?>
<!DOCTYPE html>
<html>
<head>
    <?php wp_head(); ?>
</head>
<body>
    <?php echo do_shortcode('[wordpress_social_login]'); ?>
</body>
</html>

Looking at the plugin code, the only way it could've worked on your localhost is is you had not turned on the "popup" functionality, which requires the script.

Also, even if you're not using wp_head(), you still need the <html>,<head>, and <body> tags to be valid HTML.

Source Link
Jacob Peattie
  • 43.9k
  • 10
  • 49
  • 62

You haven't included get_header() or get_footer() in your template. They will load header.php and footer.php which should include wp_head() and wp_footer(). Those last two functions are important because that's where scripts are loaded.

What you have isn't including any scripts or CSS.