index.php changed on its own

You site has been infected with malware. It will take some effort to clean it up, but it can be done. Basic steps are available via searching, and are out of scope for here, but to get started: Update WP core to latest, even if it already is. Update all themes and plugins. Remove plugins … Read more

using AJAX [object Object]

These lines are responsible for the alert: success: function(data) { window.alert(data); }, error: function(errorThrown){ window.alert(errorThrown); } In the first block, success, the callback function is executed if the ajax request succeded. The second block, error, will run if the request returned an error. Right now in both cases an alert is triggered via window.alert() function … Read more

Font Awesome Icons as squares [closed]

You should be using Font Awesome’s provided <link> or <script> tag(s) that they give you with your kit. It should look like this: <link rel=”stylesheet” href=”https://kit.fontawesome.com/xxxxx.css” crossorigin=”anonymous”> or if you prefer the JS method: <script src=”https://kit.fontawesome.com/xxxxxxx.js” crossorigin=”anonymous”></script> Copying and pasting the code from their CSS file to your local one isn’t advisable because there are … Read more

Sidebars panel in customizer

It sounds like you are trying to create a custom WordPress panel that will display your footer widget areas. To achieve this, you will need to create a custom section in your WordPress Customizer that will be responsible for displaying the widgets. You can use the WP_Customize_Section class to create your custom section, and the … Read more

How to execute a shortcode within a custom field?

Using the_field(); will just return the content of that field (guessing it’s just text field?). <?php if (is_user_logged_in()) { $userid = get_current_user_id(); get_userdata($userid); $shortcode = get_field(‘view_files_shortcode’, ‘user_’ . $userid); } ?> <?php echo do_shortcode($shortcode); ?>