Skip to content

Instantly share code, notes, and snippets.

@rachelmccollin
Last active May 17, 2018 13:38
Show Gist options
  • Save rachelmccollin/1c3bb4d5435887fc5f12ea13ce42f4a4 to your computer and use it in GitHub Desktop.
Save rachelmccollin/1c3bb4d5435887fc5f12ea13ce42f4a4 to your computer and use it in GitHub Desktop.
WPMU DEV code from child and parent themes
/*
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
*/
function compass_posted_on() { ?>
<section class="entry-meta">
<?php echo '<h3>Today's Date:</h3>'; ?>
<?php echo get_the_date(); ?>
</section>
<?php }
function compass_posted_on() { ?>
<section class="entry-meta">
<?php echo get_the_date(); ?>
</section>
<?php }
add_action ( 'compass_postmeta_before', 'compass_posted_on' );
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' );
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' );
function compasschild_postmeta() { ?>
<section class="entry-meta2">
<?php the_author_posts_link(); ?>
</section>
<?php }
add_action ( 'compass_postmeta_before', 'compasschild_postmeta', 20 );
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' );
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' );
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