Last active
May 17, 2018 13:38
-
-
Save rachelmccollin/1c3bb4d5435887fc5f12ea13ce42f4a4 to your computer and use it in GitHub Desktop.
WPMU DEV code from child and parent themes
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: LearnWP | |
Theme URI: http://rachelmccollin.com/ | |
Description: Theme for Learn WP website. Child theme of compass framework | |
Author: Rachel McCollin | |
Template: compassframework | |
Version: 1.0 | |
Tags: two-columns, fluid, responsive, mobile, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, editor-style | |
*/ |
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 compass_posted_on() { ?> | |
<section class="entry-meta"> | |
<?php echo '<h3>Today's Date:</h3>'; ?> | |
<?php echo get_the_date(); ?> | |
</section> | |
<?php } |
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 compass_posted_on() { ?> | |
<section class="entry-meta"> | |
<?php echo get_the_date(); ?> | |
</section> | |
<?php } | |
add_action ( 'compass_postmeta_before', 'compass_posted_on' ); |
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
if ( ! function_exists( 'compass_posted_on' ) ) { | |
function compass_posted_on() { ?> | |
<section class="entry-meta"> | |
<?php echo get_the_date(); ?> | |
</section> | |
<?php } | |
} | |
add_action ( 'compass_postmeta_before', 'compass_posted_on' ); |
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 compasschild_posted_on() { ?> | |
<section class="entry-meta"> | |
<?php echo '<h3>Today's Date:</h3>'; ?> | |
<?php echo get_the_date(); ?> | |
</section> | |
<?php } | |
add_action ( 'compass_postmeta_before', 'compasschild_posted_on' ); |
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 compasschild_postmeta() { ?> | |
<section class="entry-meta2"> | |
<?php the_author_posts_link(); ?> | |
</section> | |
<?php } | |
add_action ( 'compass_postmeta_before', 'compasschild_postmeta', 20 ); |
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 wpmu_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', 'wpmu_enqueue_styles' ); |
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 wpmu_enqueue_parent_styles() { | |
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'wpmu_enqueue_parent_styles' ); |
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 wpmu_remove_compass_posted_on_action(){ | |
remove_action( 'compass_postmeta_before', 'compass_posted_on' ); | |
} | |
add_action( 'wp_head', 'wpmu_remove_compass_posted_on_action' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment