Skip to content

Instantly share code, notes, and snippets.

Avatar

Anthony Brown anthonysbrown

  • Worcester, MA USA
View GitHub Profile
@anthonysbrown
anthonysbrown / functions.php
Created Feb 1, 2021
overiding funeralpress css
View functions.php
<?php
function funeralpress_custom_styles() {
wp_enqueue_style( 'wpfh-style-custom-styles', get_stylesheet_directory_uri().'funeralpress.css', array('wpfh-style','wpfh-cem-style') );
}
add_action( 'wp_enqueue_scripts', 'funeralpress_custom_styles' );
View divisoup.js
<script>jQuery(document).ready(function($) {
$("img[title]").each(function() { $(this).removeAttr("title"); });
});</script>
<script type="text/javascript">
jQuery(document).ready( function($) {
$(".et_pb_contact_captcha_question").prepend("<span> Please prove your humanity &nbsp;&nbsp;</span>" );
});
</script>
@anthonysbrown
anthonysbrown / functions.php
Last active Jan 3, 2020
Add a disclaimer on product pages by category
View functions.php
<?php
#Read article here https://worcesterwideweb.com/woocommerce-add-single-product-notice-on-a-per-category-basis-with-hierarchy/
add_filter( 'the_content', 'customizing_woocommerce_description' );
function customizing_woocommerce_description( $content ) {
global $post;
// Only for single product pages (woocommerce)
if ( is_product() ) {
# get the terms for this post
$terms = get_the_terms( $post->ID, 'product_cat' );
@anthonysbrown
anthonysbrown / functions.php
Last active Nov 27, 2019
Woocommerce check page ID and if not there then set it.
View functions.php
<?php
/*
Function: Check Pages to see if WooCommerce pages are set.
Description: Woocommerce check page ID and if not there then set it. Sometimes the woocommerce pages because unset for some reasons, use this to check it and set it automatically.
Params: None
Author: Anthony Brown (Codeable)
Email: anthony@worcesterwideweb.com
*/
function check_wp_pages_installed(){
View template.php
<?php
#service date
if($burial_date != ''){
echo '<p class="wpfh-service-line"><strong>'.get_option('wpfh_burial_date_text',__("Burial Date","sp-wpfh")).'</strong> ' .$burial_date . '</p>';
}
#service lines
if(wpfh_feature_disabled('Obituary: Service Lines') != true){
$services_information =array();
View feed.json
{
"current_page": 1,
"data": [
{
"id": 12209,
"title": "Taste Of The Wild High Prairie Dry Dog Food",
"brand": "Taste Of The Wild",
"description": "&lt;html&gt;&lt;p&gt;Taste of the Wild High Prairie Dry Dog Food is a roasted bison and venison, grain-free recipe with sweet potatoes and peas providing healthy, digestible energy for your active dog. With roasted buffalo as the first ingredient, this diet mimics an ancestral diet free of grains, packed with real meat and supplemented with fruits and vegetables. Taste of the Wild High Prairie delivers antioxidants and vitamins and minerals for a healthy lifestyle with no fillers or by-products.&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;Why We Love It&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Grain-free recipe to mimic an ancestral diet&lt;/li&gt;&lt;li&gt;High protein diet supplemented with fruits and vegetables&lt;/li&gt;&lt;li&gt;Made in the USA!&lt;/li&gt;&lt;/ul&gt;&lt;/html&gt;\r\n\r\n&lt;h3&gt;About Taste of the Wi
View function.php
<?php
/**
* Plugin Name: Gravity Forms Authorize.net Custom Fields
* Plugin URI: http://codeable.io
* Description: GF Extra fields for beyer
* Author: Anthony Brown
* Author URI: http://codeable.io
* Version: 1.0.0
* WC tested up to: 3.5.4
View upload-file.php
<?php
#make the directory
$upload_dir = '' . SP_CDM_UPLOADS_DIR . '' . $uid . '/';
if (!is_dir(SP_CDM_UPLOADS_DIR)) {
mkdir(SP_CDM_UPLOADS_DIR, 0777);
}
if (!is_dir($dir)) {
mkdir($dir, 0777);
}
@anthonysbrown
anthonysbrown / functions.php
Last active May 30, 2018
CDM change image icon
View functions.php
<?php
add_filter('sp_cdm_viewfile_image', '_cdm_custom_images',10,2);
function _cdm_custom_images($img,$r){
$ext = preg_replace('/^.*\./', '', $r['file']);
if ($ext == 'pdf') {