Skip to content

Instantly share code, notes, and snippets.

View palimadra's full-sized avatar

Pali Madra palimadra

View GitHub Profile
@palimadra
palimadra / gist:1250759
Created September 29, 2011 13:50 — forked from epicdaze/gist:1030943
#wordpress - remove wordpress version number #obfuscate #version
<!-- /* Remove version number from wordpress generated source and RSS feed.
http://www.wpbeginner.com/wp-tutorials/the-right-way-to-remove-wordpress-version-number/
*/ -->
<!-- /* remove this from header.php remove version from generated page source */ -->
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />
<!-- /* or add this to functions.php to remove version from generated page source */ -->
<?php remove_action('wp_head', 'wp_generator'); ?>
@palimadra
palimadra / gist:2199731
Created March 25, 2012 21:02 — forked from kevinkatzke/gist:1989581
CSS: Image Replacement
.ir {
border:0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@palimadra
palimadra / EmptyWidget.php
Created March 25, 2012 21:04 — forked from jonathonbyrdziak/CustomWidgetFile.php
WordPress - Plugin code to create a single widget in wordpress.
<?php
/**
* @package RedRokk
* @version 1.0.0
*
* Plugin Name: Empty Widget
* Description: Single Widget Class handles all of the widget responsibility, all that you need to do is create the html. Just use Find/Replace on the Empty_Widget keyword to rebrand this class for your needs.
* Author: RedRokk Interactive Media
* Version: 1.0.0
* Author URI: http://www.redrokk.com
@palimadra
palimadra / gist:2199752
Created March 25, 2012 21:05 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@palimadra
palimadra / WordPress - CSS for creating date badge
Created March 25, 2012 21:13 — forked from rodi01/css
WP-Create Date Badge with Wordpress and CSS
body { font-size: 62.5%; }
.post {
position: relative;
margin-left: 4.8em;
}
.entryDate {
border: 1px solid #999;
font-family: Georgia,"Times New Roman", serif;
left: -4.8em;
line-height: 1;
@palimadra
palimadra / wordpress2tumblr.rb
Created March 25, 2012 21:13 — forked from webcracy/wordpress2tumblr.rb
WP - Import tumblr to WordPress
# Export your Wordpress posts to Tumblr (also allows to delete some.)
# Author: Alexandre Solleiro <alex@webcracy.org>
# How-to:
# 1. Export your Wordpress posts (http://en.blog.wordpress.com/2006/06/12/xml-import-export/)
# 2. Edit the information below to match your settings
# 3. To import, type "ruby wordpress2tumblr.rb --run" in the command line
# 4. To delete some posts, type "ruby wordpress2tumblr.rb --delete 1,2,3,4" where 1,2,3,4 are post numbers. (Be careful not to use spaces between IDs)
# Edit these
WP_EXPORT_PATH = "./wordpress.2009-09-14.xml" # path to the Wordpress Export file
@palimadra
palimadra / gist_template
Created March 25, 2012 21:18
Gist - Template for creating gists
# Template for creating snippets and saving them on gist
# Description: [discription goes here]
# Author: Pali Madra
# URL: http://www.agilewebdev.com
# Created on: [date]
# Revised on: [date]
# More information bla bla bla bla
@palimadra
palimadra / WP_3_toolbar_add_item
Created March 25, 2012 21:36
WP - Add links to the WordPress 3.3 toolbar
# Description: [Add Links to WordPress 3.3 New Toolbar]
# Author: Pali Madra
# URL: http://www.agilewebsitedev.com
# Created on: [2012-03-26]
# Revised on: [2012-03-26]
# Instructions: Just put this snippet in the functions.php file of you theme. And note that the second and third of
# $admin_bar->add_menu are add sub menu to the first, and the parent parameter is set to the id of the first
# $admin_bar->add_menu, which in this case is my-item.
# In case you want to delete an item from the toolbar use $admin_bar->remove_menu( 'slug' );
@palimadra
palimadra / wp_redirect_login
Created March 25, 2012 21:39
WP-Redirect user after login
# Description: Redirect the user after logging in
# Author: Pali Madra
# URL: http://www.agilewebdev.com
# Created on: [2011-03-26]
# Revised on: [2011-03-26]
# Instructions: Add this to the functions.php file of your theme
<?php
function redirect_user_on_role()
@palimadra
palimadra / wp-htaccess
Created March 26, 2012 10:09
htacess file for WordPress
# WordPress .htaccess file
# Changes have to be made in lines where the domain needs to be added without any prefix like http://www.
# Description: .htaccess file for WordPress based website
# Author: Pali Madra
# URL: http://www.agilewebdev.com
# Created on: Mon Mar 26 15:37:11 2012
# Revised on: Mon Mar 26 15:37:26 2012
# Review the .htaccess file before uploading as you should not have plugins doing the same
# Many thanks to http://www.josiahcole.com/2007/07/11/almost-perfect-htaccess-file-for-wordpress-blogs/