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
<?php | |
// first, get the image object returned by ACF | |
$image_object = get_field('my_image_field'); | |
// and the image size you want to return | |
$image_size = 'thumbnail'; | |
// now, we'll exctract the image URL from $image_object | |
$image_url = $image_object['sizes'][$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
<?php | |
$image = get_field('image'); // assigns the image field to the variable of $image | |
if( !empty($image) ){ ?> <!-- if the $image variable isn't empty, display the following: --> | |
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" /> <!--displays the URL for the image variable and also the alt tag which is entered in the WordPress media library--> | |
<?php }; ?> <!--ends the if statement --> |
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
<img src="<?php echo esc_url( $sm_img ); ?>" alt="<?php echo esc_attr( $alt ); ?>" | |
srcset=" | |
<?php echo esc_url( get_the_post_thumbnail_url( get_the_ID(), 'listing-thumb-sm' ) ); ?> 250w, | |
<?php echo esc_url( get_the_post_thumbnail_url( get_the_ID(), 'listing-thumb-md' ) ); ?> 550w, | |
<?php echo esc_url( get_the_post_thumbnail_url( get_the_ID(), 'listing-thumb-lg' ) ); ?> 850w, | |
<?php echo esc_url( get_the_post_thumbnail_url( get_the_ID(), 'listing-thumb-xlg' ) ); ?> 1150w"> |
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 *********/ | |
/* Add custom separators to the Yoast SEO options | |
* Credit: Yoast team | |
* Last Tested: September 2, 2021 using Yoast SEO 17.0 on WordPress 5.8 | |
*/ | |
add_filter( 'wpseo_separator_options', 'yoast_seo_title_add_separators', 10 , 1 ); |