Skip to content

Instantly share code, notes, and snippets.

View vfontjr's full-sized avatar

Victor M. Font Jr. vfontjr

View GitHub Profile
<?php
//* Remove query strings from scripts
function _remove_script_version( $src ){
$parts = explode( '?ver', $src );
return $parts[0];
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
<?php
//* Copy this to the bottom of functions.php
//* Create a shortcode to display our custom Go to top link
add_shortcode('footer_custombacktotop', 'set_footer_custombacktotop');
function set_footer_custombacktotop($atts) {
return '<a href="#" class="top">Return to top of page</a>';
}
//* Add smooth scrolling for any link having the class of "top"
<?php
add_filter('sanitize_file_name', 'rename_image', 10, 2);
function rename_image($filename, $filename_raw) {
if ($_POST['form_id'] == '6') {
$firstname = $_POST['item_meta'][83] . '-';
$lastname = $_POST['item_meta'][84] . '-';
$category = $_POST['item_meta'][88] . '-';
$imagename = $_POST['item_meta'][85] . '-';
$assigned = $_POST['item_meta'][86] . '-';
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(fonts/opensans-light.woff2) format('woff2');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
<?php
/**
* This file adds the Front Page to the Atmosphere Pro Theme.
*
* @author StudioPress
* @package Atmosphere
* @subpackage Customizations
*/
<?php
add_filter( 'genesis_sitemap_output', 'vmf_replace_sitemap' );
function vmf_replace_sitemap() {
$sitemap = '<p>Thank you for visiting our site. Here is a list of our main pages.</p><ul>';
$sitemap .= wp_list_pages( 'title_li=&depth=1&echo=0' );
$sitemap .= sprintf( '</ul><a href="%s">Back Home</a>', home_url() );
return $sitemap;
}
<?php
<?php
/**
* Genesis Framework.
*
*
* @package Copied from Genesis\Templates
* @author StudioPress
<?php
add_image_size( string $name, int $width, int $height, bool|array $crop = false );
<?php
function vmf_limit_main_search_posts( $limit, $query ) {
if ( ! is_admin() && $query->is_main_query() ) {
return 'LIMIT 0, 40';
}
return $limit;
}
<?php
/* Customize the author box title
add_filter( 'genesis_author_box_title', 'custom_author_box_title' );
function custom_author_box_title() {
return 'About the Author';
}