Skip to content

Instantly share code, notes, and snippets.

View Ninetheme's full-sized avatar
🌴
On vacation

Ninetheme Ninetheme

🌴
On vacation
View GitHub Profile
@Asikur22
Asikur22 / functions.php
Last active November 17, 2022 11:37
Disable WP CF7 Refill #ContactForm7
/*
* Disable CF7 Refill
*/
function aa_disable_wpcf7_refill() {
global $wp_scripts;
$handle = 'contact-form-7';
$object_name = 'wpcf7';
$data = $wp_scripts->get_data( $handle, 'data' );
if ( ! empty( $data ) ) {
if ( ! is_array( $data ) ) {
@rxnlabs
rxnlabs / php-wp-enqueue-conditional-scriptload-before-dependent.php
Last active September 26, 2022 12:09
WordPress - enqueue javascript data based on WordPress conditions and other scripts. Load scripts tags before and after dependent script loads
<?php
function load_scripts(){
global $wp_scripts;
wp_register_script( 'theme-scripts', get_bloginfo('template_url').'/js/scripts.js', array('jquery'), '1.0', true );
//if we're on the woocommerce checkout page
if( is_checkout() ){
$wp_scripts->add_data('theme-scripts','data','<!--START SCRIPT STRING-->
// script to load before name-of-enqueued-script loads
<?php
/*
* WordPress Breadcrumbs
* author: Dimox
* version: 2019.03.03
* license: MIT
*/
function dimox_breadcrumbs() {
/* === OPTIONS === */
@omurphy27
omurphy27 / PHP Wordpress Removing Contact Form 7 Br tags when adding to template.html
Created March 15, 2013 00:27
PHP Wordpress Removing Contact Form 7 Br tags when adding to template
<!-- adding Contact Form 7 into Wordpress Template and removing <br> tags
add the following to the wordpress template -->
<?php echo do_shortcode('[contact-form-7 id="211" title="Spanish Contact Form"]') ; ?>
<!-- add the following into the wp-config.php -->
define ('WPCF7_AUTOP', false );
<!-- This will remove the <br> tags that get added automatically when you call Contact Form 7 from the template via shortcode-->
@jonathonbyrdziak
jonathonbyrdziak / CustomWidgetFile.php
Last active September 29, 2022 22:00
EMPTY WIDGET Plugin code to create a single widget in wordpress.
<?php
/**
* Duplicate this file as many times as you would like, just be sure to change the
* Empty_Widget class name to a custom name of your choice. Have fun! redrokk.com
*
* Plugin Name: Empty Widget
* Description: Single Widget Class handles all of the widget responsibility, all that you need to do is create the html. Just use Find/Replace on the Contact_RedRokk_Widget keyword to rebrand this class for your needs.
* Author: RedRokk Interactive Media
* Version: 1.0.0
* Author URI: http://www.redrokk.com