1. Save this code below as rawcode.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<?php /** * Plugin Name: Rawcode Wodpress Plugin demo * Plugin URI: http://aq.gthex.co.uk:10000 * Description: Display content using a shortcode to insert in a page or post * Version: 0.1 * Text Domain: rawcode-wordpress-plugin-demo * Author: mike * Author URI: http://aq.gthex.co.uk:10000 */ function rawcode_wordpress_plugin_demo($atts) { echo "<h1>hello this is the rawcode plugin demo</h1>"; } add_shortcode('rawcode-plugin-demo', 'rawcode_wordpress_plugin_demo'); |
2. Create a folder in the plugins folder called the same – “rawcode” (\wp-content\plugins\rawcode)
3. This will now show up as a plugin. Activate it.
4. In a page or post within elementor (or without) add the following shortcode. [rawcode-plugin-demo]
5. It will now appear in the post/page.
6. All the code you want should be placed between the brackets where it says “hello this is the rawcode demo”.
7. You do not add anything to the functions file.