From the course: Custom WordPress Plugins: Design, Develop, and Distribute
Unlock this course with a free trial
Join today to access over 24,500 courses taught by industry experts.
Creating a social media sharing plugin - WordPress Tutorial
From the course: Custom WordPress Plugins: Design, Develop, and Distribute
Creating a social media sharing plugin
- You're already a pro at setting up your folder for new plugins. So let's start again. Let's name our new plugin folder simple-social-sharing. Next, let's add the main PHP file for our plugin, and name it simple-social-sharing.php. Next, let's make a CSS folder and Azure CSS file. Name it social-sharing-styles.css. Lastly, let's make a JavaScript folder. Name it JS. Inside of your JavaScript folder, create a file named social-sharing.js. In the simple-social-sharing.php file, let's add our header with our plugin metadata. Let's open a PHP tag, a comment, plugin name, description, a version, the author, that's you, author URI, and text domain. Below, let's enqueue our JavaScript and CSS files. Open up code file 03_02_a and add the function SSS enque assets. Remember, do not copy the open PHP tag. This function links your CSS and JavaScript files to your main PHP file. Again, something important to remember. You have to be careful when linking files that are in different folders or…