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
@chuckreynolds
chuckreynolds / robots.txt
Last active May 22, 2023 18:44
Solid start Robots.txt for WordPress Sites. (HEADS UP: Make sure you're viewing the most recent version of this Gist) https://gist.github.com/chuckreynolds/135728/
# robots.txt for wordpress
# https://gist.github.com/chuckreynolds/135728
User-agent: *
Disallow: /cgi-bin/
Disallow: /trackback/
Disallow: /comment-page-*
Disallow: /?s=*
Disallow: /*.php$
@mfkp
mfkp / index.html
Created December 17, 2011 01:39
mailchimp ajax signup form example
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="jquery.ketchup.all.min.js" type="text/javascript"></script>
</head>
<body>
<div id="email">
<span>Enter your email to sign up</span>
<form action="/subscribe.php" id="invite" method="POST">
@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();
@smeranda
smeranda / facebook_like-box_responsive.css
Created May 1, 2012 20:37
Flexible width layout for Facebook Like Box/Activity Stream to use in Responsive Designs
/*
Make the Facebook Like box responsive (fluid width)
https://developers.facebook.com/docs/reference/plugins/like-box/
*/
/* This element holds injected scripts inside iframes that in some cases may stretch layouts. So, we're just hiding it. */
#fb-root {
display: none;
}
@butlerblog
butlerblog / auto-login-from-reg-email.php
Last active November 5, 2021 15:44
WordPress auto login from native registration email
<?php
/*
This code snippet can be added to your functions.php file (without the <?php)
to add a query string to the login link emailed to the user upon registration
which when clicked will validate the user, log them in, and direct them to
the home page.
*/
/**
* This first function is hooked to the 'user_register' action which fires
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }
@nauris-m
nauris-m / add.js
Created June 11, 2013 09:57
Google Maps: add location (ajax call to php, which logs coordinates in a file), load location (read file and show coordinates on a map)
var map = null;
var marker = null;
var infowindow = new google.maps.InfoWindow({size: new google.maps.Size(150, 50)});
function createMarker(latlng, name, html) {
var contentString = html;
var marker = new google.maps.Marker(
{
position: latlng,
map: map,
@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' ) ) :
@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',
@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(