Skip to content

Instantly share code, notes, and snippets.

View Archie22is's full-sized avatar
💭
I may be slow to respond.

ᴀʀᴄʜɪᴇ ᴍᴀᴋᴜᴡᴀ™ Archie22is

💭
I may be slow to respond.
View GitHub Profile
<?php
/**
* aheadWorks Co.
*
* NOTICE OF LICENSE
*
* This source file is subject to the EULA
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://ecommerce.aheadworks.com/AW-LICENSE.txt
@ooobo
ooobo / events-conditional-wrappers.php
Created June 23, 2012 07:48 — forked from jo-snips/events-conditional-wrappers.php
The Events Calendar: Basic Conditional Wrappers
add_action( 'wp_print_styles', 'deregister_styles', 100 );
function deregister_styles() {
if( tribe_is_month() && !is_tax() ) { // The Main Calendar Page
} elseif( tribe_is_month() && is_tax() ) { // Calendar Category Pages
} elseif( tribe_is_event() && !tribe_is_day() && !is_single() ) { // The Main Events List
} elseif( tribe_is_event() && is_single() ) { // Single Events
@mkdizajn
mkdizajn / magento aw blog recent posts widget to display short content.php
Last active April 24, 2017 10:56
magento aw blog recent posts widget to display short content
<?php
/**
* aheadWorks Co.
*
* NOTICE OF LICENSE
*
* This source file is subject to the EULA
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://ecommerce.aheadworks.com/AW-LICENSE.txt
<?php $hsl = rand(0, 240) . ',' . rand(50, 80) . '%,60%'; ?>
<style type="text/css">
a {
color: hsl(<?php echo $hsl ?>);
}
</style>
@stracker-phil
stracker-phil / popups-for-divi-full-config.php
Last active July 10, 2019 16:15
Popups for Divi: Example with all WordPress configuration options
<?php
add_filter( 'evr_divi_popup-js_data', 'my_divi_popup_options' );
function my_divi_popup_options( $config ) {
// -- Modify UI of popups --
/**
* The base z-index. This z-index is used for the overlay, every
* popup has a z-index increased by 1:
@celticwebdesign
celticwebdesign / SlickSlider-dots-custom-pagination.js
Last active July 18, 2019 08:56
SlickSlider with dots navigation and custom pagination
// see SeaGrass
if ($(".slideshow-full-container").length > 0) {
// https://github.com/kenwheeler/slick/issues/1403#issuecomment-282066130
// Test for slide length, if one, hide navigation dots
// the event needs to be run before slick is initialized
$('.slideshow-full-container').on('init', function (event, slick, direction) {
// console.log($('#full_page_slideshow .slick-slide').length);
@pixeloution
pixeloution / new-user.sql
Created June 28, 2013 17:00
Add a new admin user to wordpress via mySQL
--
-- these are the only values you need to set
-- and then just run these in squence from the mysql terminal
--
SET @USER := 'Your User Name';
SET @EMAIL := 'your@email.com';
SET @PASS := 'your-password-here';
--
-- wordpress will 'upgrade' the MD5 on your first login
@Archie22is
Archie22is / function.php
Created August 6, 2019 09:00
Send a notification or ping in WordPress when a post is created
<?php
/**
* @param int $post_id The ID of the post.
* @param WP_Post $post The post object.
* @param bool $update True if the post already exists and is being updated
*/
function wpse_post_ping( $post_id, $post, $update ) {
if ( $post->post_status === 'publish' ) { // Only fire when published
wp_remote_post(
@NickDeckerDevs
NickDeckerDevs / hubdbapi.php
Last active December 9, 2019 09:20
Two attempts at endpoints using oauth2 token
function upload_table($table_id, $csv_file_name) {
$accessToken = $_SESSION['accessToken'];
// /hubdb/api/v1/tables/:tableId/import
$url = "https://api.hubapi.com/hubdb/api/v1/tables/$table_id/import";
$postBody = [
"file" => "@$csv_file_name;type=text/csv",
"config" => [
"resetTable" => true,
"skipRows" => 1,
"format" => 'csv',
@jeffsebring
jeffsebring / wordpress_json
Created December 24, 2011 01:20
WordPress JSON Parser Example
<?php
/**
* JSON Response
* Get json data from url and decode.
*/
# Get the WordPress json parser
if ( ! function_exists( 'json_parser' ) ) :