Skip to content

Instantly share code, notes, and snippets.

@rachelmccollin
Last active July 14, 2019 06:40
Show Gist options
  • Save rachelmccollin/1cdc2382b6d4fb70c9a847ab51774a2c to your computer and use it in GitHub Desktop.
Save rachelmccollin/1cdc2382b6d4fb70c9a847ab51774a2c to your computer and use it in GitHub Desktop.
WPMU DEV Write and activate a function
echo apply_filters( 'wpmu_filter_hook', '<h3>Latest Posts</h3>' );
/************************************************************************
wpmu_add_google_fonts - register google fonts
************************************************************************/
/*****************************************************************************
wpmu_posted_on - add dates on single posts
*****************************************************************************/
function wpmu_posted_on() {
if ( is_singular( 'post' ) ) {?>
<section class="entry-meta">
<?php echo get_the_date(); ?>
</section>
<?php }
}
add_action ( 'wpmu_before_content', 'wpmu_posted_on' );
/*****************************************************************************
wpmu_posted_on - add dates on single posts - THIS IS INCORRECT
*****************************************************************************/
function wpmu_posted_on() {
<section class="entry-meta">
<?php echo get_the_date(); ?>
</section>
}
if ( is_singular( 'post' ) ) {
add_action ( 'wpmu_before_content', 'wpmu_posted_on' );
}
/*****************************************************************************
wpmu_posted_on - add dates on single posts - THIS IS INCORRECT
*****************************************************************************/
if ( is_singular( 'post' ) ) {
function wpmu_posted_on() {
<section class="entry-meta">
<?php echo get_the_date(); ?>
</section>
}
}
add_action ( 'wpmu_before_content', 'wpmu_posted_on' );
do_action( 'wpmu_before_content' );
/*****************************************************************************
wpmu_heading - override title of latest posts section
*****************************************************************************/
function wpmu_heading() {
<h3>Recent Posts</h3>
}
add_filter ( 'wpmu_filter_hook', 'wpmu_heading' );
wp_register_style( 'googleFonts', 'https://fonts.googleapis.com/css?family=Assistant|Oswald:300');
wp_enqueue_style( 'googleFonts');
function wpmu_add_google_fonts() {
}
add_action( 'wp_enqueue_scripts', 'wpmu_add_google_fonts' );
/************************************************************************
wpmu_add_google_fonts - register google fonts
************************************************************************/
function wpmu_add_google_fonts {
wp_register_style( 'googleFonts', 'https://fonts.googleapis.com/css?family=Assistant|Oswald:300');
wp_enqueue_style( 'googleFonts');
}
add_action( 'wp_enqueue_scripts', 'wpmu_add_google_fonts' );
/************************************************************************
wpmu_add_google_fonts - register google fonts
************************************************************************/
function wpmu_add_google_fonts {
wp_register_style( 'googleFonts', 'https://fonts.googleapis.com/css?family=Assistant|Oswald:300');
wp_enqueue_style( 'googleFonts');
}
/*****************************************************************************
wpmu_posted_on - add dates on single posts
*****************************************************************************/
function rachelmcc_posted_on() {
<section class="entry-meta">
<?php echo get_the_date(); ?>
</section>
}
/*****************************************************************************
wpmu_posted_on - add dates on single posts
*****************************************************************************/
function rachelmcc_posted_on() {
<section class="entry-meta">
<?php echo get_the_date(); ?>
</section>
}
add_action( 'wpmu_before_content', 'rachelmcc_posted_on' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment