Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Rock mattrock1

View GitHub Profile
View analytics code via child theme.php
<?php
/* Add Google analytics code to wp_head */
add_filter('wp_head','add_analytics_to_wphead',15);
function add_analytics_to_wphead(){
?>
<script>
//analytics or tag manager code
</script>
@salcode
salcode / .gitignore
Last active Jan 26, 2021
Please see https://salferrarello.com/wordpress-gitignore/ for the canonical version of this WordPress .gitignore file. Note: I do not receive notifications for comments here (because GitHub does not send notifications on Gists)
View .gitignore
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20180808
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
@tjhole
tjhole / WORDPRESS: Hide ACF by CSS in Admin Area
Created Nov 29, 2013
WORDPRESS: Hide ACF via CSS in admin area
View WORDPRESS: Hide ACF by CSS in Admin Area
// Editing the WordPress Dashboard Header
function wp_admin_dashboard_header_colour() {
echo '<style type="text/css">
#toplevel_page_edit-post_type-acf { display:none; }
</style>';
}
add_action('admin_head', 'wp_admin_dashboard_header_colour');