Skip to content

Instantly share code, notes, and snippets.

View chancecorbeil's full-sized avatar
🐢
Turtle Stuff

Chance Corbeil chancecorbeil

🐢
Turtle Stuff
View GitHub Profile
@chancecorbeil
chancecorbeil / CSS for solid color alerts
Last active August 29, 2015 14:22
Solid color alerts for Contact Form 7
/* Solid color alerts for Contact Form 7 */
div.wpcf7-mail-sent-ok {
background-color: #398f14;
color: #fff;
border: 2px solid #398f14;
display: inline-block !important;
}
div.wpcf7-validation-errors {
@chancecorbeil
chancecorbeil / Alternate title tags in WordPress
Created June 27, 2015 23:48
Alternating h1 and h2 title tags, depending if page is home page or not
<?php if(is_front_page()) : ?>
<!-- This is a homepage -->
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<?php endif; ?>
<?php if(!is_front_page()) : ?>
<!-- This is not a homepage -->
<h2 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h2>
<?php endif; ?>
<?php
$postid = get_the_ID();
// echo $postid; // TEST
?>
// Load custom fields using a post id
$postid = 315 ; // post ID 315
$post = get_post( $postid ); // Use the post ID to get the post data
echo $postid; // The post ID
echo $post->post_title; // The post title
echo $post->route_id; // The custom field
function tcp_list_timetable_route_ids( $args = array() ) {
if ( ! post_type_exists('route') ) {
// Fail silently
return;
}
$defaults = array(
'before' => '<div class="tcp_route_list">',
'after' => '</div>',
'sep' => ' ',
'use_color' => false, // TODO - doesn't work
@chancecorbeil
chancecorbeil / H1 png with alt attribute for home page only.php
Created February 11, 2022 19:35
Use a png as the h1 on the home page using the alt attribute. Remove heading tag on any pagethat is not the home page. For WordPress websites.
<!-- Logo -->
<?php
if (is_front_page()) {
echo '<h1 class="site-logo"><a href="' . esc_url( home_url( '/' ) ) . '"><img src="' . get_stylesheet_directory_uri() . '/images/logo/logo.png"
alt="The H1 Heading and Logo" />
</a></h1>';
} else {
echo '<a href="' . esc_url( home_url( '/' ) ) . '" class="site-logo"><img src="' . get_stylesheet_directory_uri() . '/images/logo/logo.png"
alt="The Logo" />
@chancecorbeil
chancecorbeil / H1 svg with alt attribute for home page only.php
Created February 11, 2022 19:51
Use a svg as the h1 on the home page using screen reader only text inside the link tag. Remove heading tag on any page that is not the home page. For WordPress websites.
<!-- Logo (SVG) -->
<?php
if (is_front_page()) {
echo '<h1 class="site-logo"><a href="' . esc_url( home_url( '/' ) ) . '">';
get_template_part('images/logo/logo-base-theme.svg');
echo '<span class="is-sr-only">The h1 and logo</span></a></h1>';
} else {
echo '<a href="' . esc_url( home_url( '/' ) ) . '" class="site-logo">';
get_template_part('images/logo/logo-base-theme.svg');
echo '<span class="is-sr-only">The logo</span></a>';
// Add horizontal scrollbar on top of block
.block-container,
.block {
transform:rotateX(180deg);
-ms-transform:rotateX(180deg); /* IE 9 */
-webkit-transform:rotateX(180deg); /* Safari and Chrome */
overflow-x: auto;
}
// * Primary Color
$primary: #6d597a;
$secondary: #b56576;
$accent: #e56b6f;
// Primary - Lighten
$primary-lighten-10: mix(white, $primary, 10%);
$primary-lighten-20: mix(white, $primary, 20%);
$primary-lighten-30: mix(white, $primary, 30%);
$primary-lighten-40: mix(white, $primary, 40%);