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 | |
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/ | |
/* Change size for Yoast SEO OpenGraph image for all content | |
* Credit: Yoast Development team | |
* Last Tested: May 19 2020 using Yoast SEO 14.1 on WordPress 5.4.1 | |
* Accepts WordPress reserved image size names: 'thumb', 'thumbnail', 'medium', 'large', 'post-thumbnail' | |
* Accepts custom image size names: https://developer.wordpress.org/reference/functions/add_image_size/ | |
*/ | |
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
/* | |
Link discount codes to affiliates. | |
*/ | |
//this is the parameter we're looking for to find affiliates... based on which plugin/etc you are using | |
define('PMPRO_LDC2AFF_KEY', 'wpam_id'); //Affiliates Manager Plugin | |
//define('PMPRO_LDC2AFF_KEY', 'pa'); //WordPress Lightweight Affiliates | |
//define('PMPRO_LDC2AFF_KEY', 'ref'); //AffiliateWP | |
//helper function to get the values from options and make sure they are an array | |
function pmpro_ld2aff_getOptions() { |
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: Convert Custom Taxonomy to Custom Post Type | |
Plugin URI: N/A | |
Description: A plugin to convert a Custom Taxonomy to a Custom Post Type and transfer associated metadata. | |
Version: 0.1 | |
Author: Strap1 | |
Author URI: http:/www.hiphopinenglish.com | |
/** Convert Taxonomy '%name%' to CPT '%name%' **/ |
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
add_filter( 'the_content', 'post_love_display', 99 ); | |
function post_love_display( $content ) { | |
$love_text = ''; | |
if ( is_single() ) { | |
$love = get_post_meta( get_the_ID(), 'post_love', true ); | |
$love = ( empty( $love ) ) ? 0 : $love; | |
$love_text = '<p class="love-received"><a class="love-button" href="#" data-id="' . get_the_ID() . '">give love</a><span id="love-count">' . $love . '</span></p>'; |