This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: My Cool Name | |
Plugin URI: https://jamestrevorlees.me/my-first-plugin | |
Description: This is my first WordPress Plugin | |
Author: James Lees | |
Author URI: https://jamestrevorlees.me | |
Version: 1.0 | |
*/ | |
//Create function for plugin test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sample_function ( $content ) { | |
$content .= 'test'; | |
return $content; | |
} | |
add_filter( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Actions are triggered by specific events that take place take place in WordPress eg. publishing a post | |
function sample_function () { | |
} | |
add_action('wp_head', 'sample_function'); /* we are hooking sample_function into the wp_head (an existing WP function) so that when wp_head fires then 'sample_function' is executed. | |
//we have parameters that are available to our functions depending on the actions that have been fired |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Plugin Development 101 | |
Plugin URI: https://pippinsplugins.com/series/plugin-development-101/ | |
Description: An introductory course on plugin development | |
Author: Pippin Williamson | |
Version: 1.0 | |
Author URI: https://pippinsplugins.com | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create Post Type for the In Person Assessment Logging | |
function psgp_in_person_assessments_create_post_type() { | |
/* Set up the arguments for the post type. */ | |
$args = array( | |
/** | |
* A short description of what your post type is. As far as I know, this isn't used anywhere | |
* in core WordPress. However, themes may choose to display this on post type archives. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1.First create the button / CTA for the youtube video. eg. | |
<div> | |
<a href="https://www.youtube.com/embed/gUNSGk3SHhI" class="lightbox"><i class="fa fa-play fa-8 home-play-btn" aria-hidden="true" style="font-size: 4em"></i></a> | |
</div> | |
#ensure that the class "lightbox" is added. | |
#2.Add the following html at the base of the doc | |
<div id="youtubelightbox" class="parent"> | |
<div class="centeredchild"> | |
<div class="videowrapper"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Often we have to add or remove files from a gitignore. In order to do so I choose to recache git and this is how I do it: | |
1. make your .gitignore changes | |
2. Recache git | |
cmd: git rm -r --cached . | |
--> this tells git to remove the cache for all your files that are currently being tracked | |
3. Add all the files to git again |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="col"> | |
<ul> | |
{% set i = 1 %} | |
{% for item in post.get_field('home_what_band_bullets_section_a') %} | |
<li>{{ item.bullet_copy_text }}</li> | |
{% set i = i + 1 %} | |
{% endfor %} | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
UPDATED: December 31, 2011. | |
Modifications: | |
- Truncated the longest country names, including: | |
-- British Indian Ocean Territories (Chagos Archipelago) -> British Indian Ocean Territories | |
-- South Georgia and the South Sandhich Islands -> South Georgia & S. Sandwich Islands |
OlderNewer