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
@sudipbd
sudipbd / functions.php
Created November 19, 2016 08:22
WordPress numeric pagination
<?php
function ct_paging_nav() {
// Don't print empty markup if there's only one page.
if ( $GLOBALS['wp_query']->max_num_pages < 2 ) {
return;
}
$paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1;
$pagenum_link = html_entity_decode( get_pagenum_link() );
$query_args = array();
@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',
<?php
if(!function_exists('wc_get_products')) {
return;
}
$paged = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1;
$ordering = WC()->query->get_catalog_ordering_args();
$ordering['orderby'] = array_shift(explode(' ', $ordering['orderby']));
$ordering['orderby'] = stristr($ordering['orderby'], 'price') ? 'meta_value_num' : $ordering['orderby'];
@laurenclark
laurenclark / index.html
Created June 25, 2018 21:51
Pure CSS Social Media Icons
<div class="footer-social-icons">
<h4 class="_14">Follow us on</h4>
<ul class="social-icons">
<li><a href="" class="social-icon"> <i class="fa fa-facebook"></i></a></li>
<li><a href="" class="social-icon"> <i class="fa fa-twitter"></i></a></li>
<li><a href="" class="social-icon"> <i class="fa fa-rss"></i></a></li>
<li><a href="" class="social-icon"> <i class="fa fa-youtube"></i></a></li>
<li><a href="" class="social-icon"> <i class="fa fa-linkedin"></i></a></li>
<li><a href="" class="social-icon"> <i class="fa fa-google-plus"></i></a></li>
</ul>
@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);
@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(