This file contains hidden or 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 | |
/** | |
* Create function my_responsive_thumbnail() to output responsive featured image | |
* Function can be called from within the loop of any template file using my_responsive_thumbnail(get_the_ID()); | |
*/ | |
function my_responsive_thumbnail($post_id){ | |
// Get the featured image ID | |
$attachment_id = get_post_thumbnail_id($post_id); | |
// Get the alt text or set the $alt_text variable to the post title if no alt text exists |
This file contains hidden or 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 hidden or 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 hidden or 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 |
This file contains hidden or 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 | |
// Enqueue the parent theme stylesheet, then the child theme stylesheet. | |
// Used in place of @import rule in child theme style.css | |
function child_theme_name_enqueue_styles() { | |
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); | |
wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( 'parent-style' ) ); | |
} | |
add_action( 'wp_enqueue_scripts', 'child_theme_name_enqueue_styles' ); |
This file contains hidden or 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 | |
// Override the parent theme fonts | |
function twentysixteen_fonts_url() { | |
$fonts_url = 'https://fonts.googleapis.com/css?family=Playfair+Display:400,400i,700,700i,900,900i|Roboto+Slab:400,700'; | |
return $fonts_url; | |
} | |
?> |
This file contains hidden or 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 | |
/** | |
* Custom header for the WPCampus child theme. | |
* Moves the header image to the top. | |
* | |
* The template for displaying the header | |
* | |
* Displays all of the head element and everything up until the "site-content" div. | |
* | |
* @package WordPress |
This file contains hidden or 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 hidden or 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 | |
/** | |
* Adds custom classes to the array of body classes. | |
* | |
* @param array $classes Classes for the body element. | |
* @return array (Maybe) filtered body classes. | |
*/ | |
function wpcampus_body_classes( $classes ) { | |
// Adds a class of no-sidebar to custom no-sidebar page template. | |
if ( is_page_template('page-no-sidebar.php') ) { |
This file contains hidden or 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 |
OlderNewer