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 for responsive featured images. | |
* Create a <picture> element and populate it with appropriate image sizes for different screen widths. | |
* Works in place of the_post_thumbnail(); | |
*/ | |
function simone_the_responsive_thumbnail($post_id) { | |
// Check to see if there is a transient available. If there is, use it. | |
if ( false === ( $thumb_data = get_transient( 'featured_image_' . $post_id ) ) ) { | |
simone_set_image_transient($post_id); |
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
Verifying that +mor10 is my openname (Bitcoin username). https://onename.com/mor10 |
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: WPCampus Functionality | |
Plugin URI: https://2016.wpcampus.org/schedule/wordpress-masterclass/ | |
Description: Adds custom post types and taxonomies | |
Version: 1.0.0 | |
Author: Morten Rand-Hendriksen | |
Author URI: https://lynda.com/mor10 | |
License: GPL2 | |
License URI: https://www.gnu.org/licenses/gpl-2.0.html |
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 | |
/** | |
* Prints HTML with category and tags for current post. | |
* Augmented from the Twenty Sixteen original, found in inc/template-tags.php | |
*/ | |
function twentysixteen_entry_taxonomies() { | |
// Display Class taxonomy when available | |
$tax_class_title = '<span class="tax-title">' . __( 'Class:', 'wpcampus' ) . '</span> '; | |
$class_list = get_the_term_list( $post->ID, 'class', $tax_class_title, _x( ', ', 'Used between list items, there is a space after the comma.', 'wpcampus' ) ); |
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 | |
function twentysixteen_setup() { | |
/* | |
* Make theme available for translation. | |
* Translations can be filed in the /languages/ directory. | |
* If you're building a theme based on Twenty Sixteen, use a find and replace | |
* to change 'twentysixteen' to the name of your theme in all the template files | |
*/ | |
load_theme_textdomain( 'wpcampus', get_template_directory() . '/languages' ); |
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 | |
// Make sure the plugin is active | |
if ( function_exists( 'get_field' ) ) { | |
$lecture_video = get_field('lecture_video'); | |
} | |
// If the current post is a Lecture post and we have a lecture video URL, use oEmbed | |
if ( 'lecture' === get_post_type() ) { | |
if ( $lecture_video ) { | |
echo wp_oembed_get( $lecture_video ); | |
} |
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: WPCampus Functionality | |
Plugin URI: https://2016.wpcampus.org/schedule/wordpress-masterclass/ | |
Description: Adds custom post types and taxonomies | |
Version: 1.0.0 | |
Author: Morten Rand-Hendriksen | |
Author URI: https://lynda.com/mor10 | |
License: GPL2 | |
License URI: https://www.gnu.org/licenses/gpl-2.0.html |
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 | |
/** | |
* Include Lecture post type in the main and search queries | |
*/ | |
function wpcampuscpt_query_filter( $query ) { | |
if ( !is_admin() && $query->is_main_query() ) { | |
if ( $query->is_search() || $query->is_home() ) { | |
$query->set('post_type', array( 'post', 'lecture' ) ); | |
} | |
} |
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 | |
/** | |
* Prints HTML with meta information for the categories, tags, etc. | |
* Augmented from the Twenty Sixteen original, found in inc/template-tags.php | |
*/ | |
function twentysixteen_entry_meta() { | |
if ( 'post' === get_post_type() || 'lecture' === get_post_type() ) { | |
$author_avatar_size = apply_filters( 'twentysixteen_author_avatar_size', 49 ); | |
printf( '<span class="byline"><span class="author vcard">%1$s<span class="screen-reader-text">%2$s </span> <a class="url fn n" href="%3$s">%4$s</a></span></span>', | |
get_avatar( get_the_author_meta( 'user_email' ), $author_avatar_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
/* | |
Theme Name: Twenty Sixteen Child Theme | |
Theme URI: https://2016.wpcampus.org/schedule/wordpress-masterclass/ | |
Description: A Twenty Sixteen child theme | |
Author: Morten Rand-Hendriksen | |
Author URI: https://lynda.com/mor10 | |
Template: twentysixteen | |
Version: 1.0.0 | |
License: GNU General Public License v2 or later | |
License URI: http://www.gnu.org/licenses/gpl-2.0.html |
OlderNewer