Skip to content

Instantly share code, notes, and snippets.

View cocolee's full-sized avatar

Rıfat Caner Anıltürk cocolee

View GitHub Profile
@chrisguitarguy
chrisguitarguy / cpt-permalinks.php
Created October 10, 2011 17:28
How to add fields to the WordPress permalinks page
@Grawl
Grawl / dabblet.css
Created January 18, 2012 00:48
CSS triangle with border
/**
* CSS triangle with border
*/
html,
body {
height: 100%;
}
body {
padding: 10px 30px 0;
background: linear-gradient(45deg, pink , blue) 100% 100% no-repeat;
@ashfame
ashfame / Correct-way-to-enqueue-scripts-and-style-in-WordPress.php
Created February 27, 2012 13:36
Correct way to enqueue scripts and style in WordPress
<?php
/**
* Register Styles and Scripts
*/
add_action( 'wp_enqueue_scripts', 'ft_scripts_styles' );
function ft_scripts_styles() {
@kevinSuttle
kevinSuttle / meta-tags.md
Last active May 1, 2025 21:56 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags
@kasparsd
kasparsd / custom-post-taxonomy-permalinks.php
Created June 13, 2012 15:47
Create permalink structure URLs for custom post types that include all parent terms from a custom taxonomy
<?php
/*
Term Archive Pages:
- http://example.com/recipes/dinner/
- http://example.com/recipes/breakfast,brunch/
Single Recipe Pages:
- http://example.com/recipes/dinner/soup-title/
@gyrus
gyrus / shortcodes.php
Last active June 11, 2018 20:40
TinyMCE button for WordPress shortcode
<?php
/**
* Skeletal sample shortcode
*/
add_shortcode( 'pilau-sample', 'pilau_sample_shortcode' );
function pilau_sample_shortcode( $atts ) {
extract( shortcode_atts( array(
'text' => ''
), $atts ) );
@leoken
leoken / redirect-parent-to-child.php
Created December 28, 2012 06:56
Redirect Parent to First Child - WordPress Plugin
<?php
/*
Plugin Name: Redirect Parent to First Child
Plugin URI: http://www.nathanrice.net/parent-to-first-child
Description: This plugin will do a 301 redirect on top-level parent pages, to their first child page, based first on menu order, then post title if no menu order is set. It only redirects if a *published* child page actually exists.
Version: 0.1
Author: Nathan Rice
Author URI: http://www.nathanrice.net/
License: This plugin is licensed under GPL.
@scottnix
scottnix / gist:5816616
Created June 19, 2013 18:24
caroufredsel slider setup for Thematic Theme responsive setup, images 1250x425 with post title as caption this runs by tagging a post featured.
/* css */
.slider {
margin: 1.625em 0;
}
.slider ul {
margin: 0;
padding: 0;
}
@media (min-width: 680px) {
@PaulKinlan
PaulKinlan / criticalcss-bookmarklet-devtool-snippet.js
Last active March 12, 2025 01:22
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
@dovy
dovy / Redux-required-arg-exampes.php
Last active March 4, 2021 14:16
Example of the required attribute for the Redux Framework.
<?php
$options = array(
'required' => array('id','equals',array( 1,3 ) ) // Multiple values
);
$options = array(
'required' => array('id','equals', array( 1 ) ) // Single value
);