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
@Archie22is
Archie22is / pagination.html
Created November 24, 2015 07:43
jQuery / JavaScript pagination | Source: http://jsfiddle.net/fSmEL/167/
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
@Archie22is
Archie22is / bot_protect.html
Created November 26, 2015 09:31
Spam Protected Email Address Using JavaScript | source: http://help.website-creator.org/
<script language="JavaScript">
var username = "[your_username]";
var hostname = "[your_mail_account_domain]";
var linktext = username + "@" + hostname ;
document.write("<a href='" + "mail" + "to:" + username + "@" + hostname + "'>" + linktext + "</a>");
</script>
@Archie22is
Archie22is / script.js
Created December 3, 2015 09:59
Make div with link clickable and open in a new tab using jQuery
(function($) {
// This will make a an entire div clickable
$(".awards-content").click(function() {
window.location = $(this).find("a").attr("href");
return false;
});
// This will make the entire div clickable and open in a new tab
@Archie22is
Archie22is / index.html
Created January 14, 2016 09:40
Centered Bottom Border With A Set Width (Centered Underline)
<!-- HTML -->
<div class="outer">
Lorem ipsum dolor sit amet
<div class="inner">&nbsp;</div>
</div>
<!-- CSS -->
<style>
.outer {
@Archie22is
Archie22is / loop.php
Created February 8, 2016 14:52
A little bullshit....
<?php
// short cut to heaven
the_content();
?>
<?php
// another long drive down table mountain
$content = get_the_content();
echo apply_filters( 'the_content', $content );
?>
@Archie22is
Archie22is / index.html
Created February 22, 2016 07:44
Show / Hide Divs using jQuery
<!-- HTML -->
<div class="buttons">
<a id="showall">All</a>
<a class="showSingle" target="1">Div 1</a>
<a class="showSingle" target="2">Div 2</a>
<a class="showSingle" target="3">Div 3</a>
<a class="showSingle" target="4">Div 4</a>
</div>
<div id="div1" class="targetDiv">Lorum Ipsum1</div>
@Archie22is
Archie22is / loop.php
Created March 24, 2016 09:16
Combining queries with different arguments per post type
<?php
$term = get_term_by( 'slug', get_query_var( 'tag' ), "post_tag" );
$tagslug = $term->slug;
$post_types = get_post_types('','names');
?>
<?php
//first query
$blogposts = get_posts(array(
'tag' => $tagslug, //first taxonomy
'post_type' => $post_types,
@Archie22is
Archie22is / loop.php
Created March 24, 2016 09:18
WP_Query with two post types, but requiring category on only one of those post types
$args = array(
'post_type' => 'image',
'category_name' => $cat,
'meta_key' => 'total_votes',
'orderby' => 'date meta_value_num',
);
$loop = new WP_Query( $args );
$args = array(
'post_type' => 'video',
@Archie22is
Archie22is / custom_loop.php
Created March 24, 2016 09:19
Custom Taxonomy - Related Posts Query
<?php
global $post;
$terms = get_the_terms( $post->ID , 'badge', 'string');
$do_not_duplicate[] = $post->ID;
$postnum = 0;
if(!empty($terms)){
foreach ($terms as $term) {
query_posts( array(
'badge' => $term->slug,
@Archie22is
Archie22is / taxonomies.php
Created May 16, 2016 13:20 — forked from wpsmith/taxonomies.php
Registering Multiple Taxonomies
<?php
/**
* Taxonomies
*
* This file registers any custom taxonomies
*
* @package WPS_Starter_Genesis_Child
* @author Travis Smith <[email protected]>
* @copyright Copyright (c) 2012, Travis Smith
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License