Skip to content

Instantly share code, notes, and snippets.

@sterndata
Last active November 11, 2016 05:09
Show Gist options
  • Save sterndata/02e0db2c38d13fe9185d73156f59834f to your computer and use it in GitHub Desktop.
Save sterndata/02e0db2c38d13fe9185d73156f59834f to your computer and use it in GitHub Desktop.
Underscores Snippets
<?
/* replace this part of the function theme_scripts in "Enqueue scripts and styles" */
function theme_scripts() {
$themecsspath = get_stylesheet_directory() . '/style.css';
wp_enqueue_style( 'theme-style', get_stylesheet_uri(), array(), filemtime( $themecsspath )
);
/* change the excerpt's more.. to a linked text Read More...
* be sure to add a class for more-link
*/
function theme_excerpt_more( $more ) {
global $post;
return ' [<a class="more-link" href="' . get_permalink( $post->ID ) . '">Read more..</a>]';
// return "...";
}
/*
* add theme options page (ACF)
*/
acf_add_options_page(array(
'page_title' => 'Theme General Settings',
'menu_title' => 'Theme Settings',
'menu_slug' => 'theme-general-settings',
'capability' => 'edit_posts',
'redirect' => false,
));
/*
* Hide the ACF menu
* /
// /**
* hide the ACF menu in admin
*/
// uncomment when site goes live to hide the ACF menu
// add_filter('acf/settings/show_admin', '__return_false');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment