Skip to content

Instantly share code, notes, and snippets.

View ckschmieder's full-sized avatar

Chris Schmieder ckschmieder

View GitHub Profile
h1 {
font-family: 'MuseoSans-700', arial, helvetica, sans-serif;
color: white!important;
}
h2 {
font-size: 1.625em;
font-family: 'MuseoSans-700', arial, helvetica, sans-serif;
}
h3 {
@ckschmieder
ckschmieder / no-comments.php
Last active January 14, 2023 17:26 — forked from mattclements/function.php
Wordpress Disable Comments (add to function.php)
<?php
// Add to existing function.php file
// Disable support for comments and trackbacks in post types
function df_disable_comments_post_types_support() {
$post_types = get_post_types();
foreach ($post_types as $post_type) {
if(post_type_supports($post_type, 'comments')) {
remove_post_type_support($post_type, 'comments');
$(function() {
$("#NationalPhotoMonth_submitButton").click(function(event) {
if (!$("#NationalPhotoMonth_Field_48").is(":checked")) {
event.stopImmediatePropagation();
alert('You must agree to the Terms and Conditions!');
}
});
});
@ckschmieder
ckschmieder / gist:0e3d7e2f70b08773c28c3ad5b508e813
Created January 27, 2017 15:50
functions.php (error on line 139?)
<?php
if(!function_exists('dynamo_file')) {
/**
*
* Function used to get the file absolute path - useful when child theme is used
@ckschmieder
ckschmieder / ancestors-image.php
Created October 6, 2016 15:42
Need this to work with my custom image field in stead of the_post_thumbnail
<?php
global $post;
$parents = get_post_ancestors( $post->ID );
/* Get the ID of the 'top most' Page if not return current page ID */
$id = ($parents) ? $parents[count($parents)-1]: $post->ID;
$image = get_field('top_image');
if( $image( $id )) {
the_post_thumbnail( $id, 'thumbnail');
}
@mattclements
mattclements / function.php
Last active May 15, 2025 08:56
Wordpress Disable Comments (add to function.php)
<?php
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_redirect(admin_url());
exit;
}