Skip to content

Instantly share code, notes, and snippets.

View richtabor's full-sized avatar

Rich Tabor richtabor

View GitHub Profile
<?php //* do not include php tag
add_filter( 'schema_wp_types', 'schema_wp_new_add_schema_type_7623456' );
/**
* Add New type to Schema Types options
*
* @since 1.0
*/
function schema_wp_new_add_schema_type_7623456( $options ) {
blockquote {
margin: 0;
color: #303030;
font-family: "Playfair Display", serif;
font-size: 24px;
font-size: 1.5rem;
line-height: 1.8;
margin: 12% auto;
width: 90%;
padding-left: 30px;
body .upsells.products h2,
body .related.products h2,
body #woocommerce-info-trigger,
body #woocommerce-reviews-trigger,
body .product_title.entry-title {
font-size: 22px !important;
}
@media screen and (min-width: 500px) {
body.single-portfolio .navigation a {
font-size: 40px;
}
@media screen and (max-width: 1920px) and (min-width: 823px) {
body.single-portfolio .navigation a {
font-size: 4.75vw;
}
}
@richtabor
richtabor / ava-portfolio-pagination-text.php
Created October 12, 2017 15:01
Use these filters to change the text of the "Next" and "Prev" pagination on the singular portfolio views.
function ava_child_portfolio_prev_text() {
return 'Previous';
}
add_filter( 'ava_portfolio_pagination_prev', 'ava_child_portfolio_prev_text', 10, 1 );
function ava_child_portfolio_next_text() {
return 'Continue';
}
add_filter( 'ava_portfolio_pagination_next', 'ava_child_portfolio_next_text', 10, 1 );
.customize-partial-edit-shortcuts-shown {
.custom-logo-link {
align-items: center;
display: flex;
justify-content: center;
margin-left: -30px; // Pull it to the left, to keep the logo centered when the edit link is shown.
.customize-partial-edit-shortcut,
.customize-partial-edit-shortcut-button {
@richtabor
richtabor / starter-content-custom-logo.php
Last active December 10, 2023 22:34
Adding a custom logo to a WordPress theme's starter content.
<?php
/**
* Theme defaults and support for WordPress features.
*/
function prefix_setup() {
/*
* Define starter content for the theme.
* See: https://make.wordpress.org/core/2016/11/30/starter-content-for-themes-in-4-7/
*/
<?php
/**
* Adds custom classes to the array of body classes.
*
* @param array $classes Classes for the body element.
* @return array
*/
function prefix_body_classes( $classes ) {
// Add class to the body if the sidebar has widgets.
if ( is_active_sidebar( 'sidebar-1' ) && ! is_page() ) {
File path for a pre WordPress 4.7 asset:
<img src="<?php echo get_template_directory_uri(); ?>/images/filename.png" />
File path for a WordPress 4.7 + asset:
<img src="<?php echo get_theme_file_uri( ‘/images/filename.png’ ); ?>" />
if(!function_exists('get_theme_file_uri')){
function get_theme_file_uri( $file = '' ) {
$file = ltrim( $file, '/' );
if ( empty( $file ) ) {
$url = get_stylesheet_directory_uri();
} elseif ( file_exists( get_stylesheet_directory() . '/' . $file ) ) {
$url = get_stylesheet_directory_uri() . '/' . $file;
} else {
$url = get_template_directory_uri() . '/' . $file;
}