Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Font Awesome Icons Array (4.3.0)
* @author Monzurul Haque
* @author_uri https://github.com/farukham
**/
$icons_arr = array(
__("None", "fifothemes") => "none",
__("Adjust", "fifothemes") => "fa-adjust",
<?php
/* add this on init hook */
register_taxonomy_for_object_type( 'category', 'attachment' );
?>
/* Set Default Mail From Name */
function custom_wp_mail_from_name( $original_email_from ){
return 'Danny Wilson';
}
add_filter( 'wp_mail_from_name', 'custom_wp_mail_from_name' );
/* Set Default Mail From email */
function custom_wp_mail_from( $original_email_address ){
return 'danny@iamdannywilson.com';
}
@jeweltheme
jeweltheme / LICENSE
Last active August 31, 2015 20:28 — forked from ourmaninamsterdam/LICENSE
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@jeweltheme
jeweltheme / wordpress-plugin-svn-to-git.md
Last active September 2, 2015 19:54 — forked from kasparsd/wordpress-plugin-svn-to-git.md
Using Git with Subversion Mirroring for WordPress Plugin Development
@jeweltheme
jeweltheme / vps-setup.sh
Created October 26, 2015 08:55 — forked from EmranAhmed/vps-setup.sh
Simple and Straightforward VPS ( ubuntu and debian ) setup :)
#!/bin/bash
# Upload vps-setup.sh file
# open terminal and change permission like: chmod +x ./setup.sh
# ./vps-setup.sh
# delete this file after setup :)
COLOR_RESET="\033[33;0m"
COLOR_RED="\033[33;31m"
COLOR_GREEN="\033[33;32m"
@jeweltheme
jeweltheme / Galaxy Of Tutorial Torrents
Created September 1, 2016 15:46 — forked from iHassan/Galaxy Of Tutorial Torrents
Ultimate Galaxy Of Tutorial Torrents
=============================
**http://kickass.to/infiniteskills-learning-jquery-mobile-working-files-t7967156.html
**http://kickass.to/lynda-bootstrap-3-advanced-web-development-2013-eng-t8167587.html
**http://kickass.to/lynda-css-advanced-typographic-techniques-t7928210.html
**http://kickass.to/lynda-html5-projects-interactive-charts-2013-eng-t8167670.html
**http://kickass.to/vtc-html5-css3-responsive-web-design-course-t7922533.html
*http://kickass.to/10gen-m101js-mongodb-for-node-js-developers-2013-eng-t8165205.html
*http://kickass.to/cbt-nuggets-amazon-web-services-aws-foundations-t7839734.html
<?php
// Example 1
$show_after_p = 2;
$content = apply_filters('the_content', $post->post_content);
if(substr_count($content, '<p>') > $show_after_p)
{
$contents = explode("</p>", $content);
$p_count = 1;
foreach($contents as $content)
{
@jeweltheme
jeweltheme / get_ip_address_php
Last active May 5, 2017 19:28 — forked from mrkpatchaa/get_ip_address_php
Get user ip address in php
<?PHP
function getUserIP()
{
$client = @$_SERVER['HTTP_CLIENT_IP'];
$forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$remote = $_SERVER['REMOTE_ADDR'];
if(filter_var($client, FILTER_VALIDATE_IP))
{
@jeweltheme
jeweltheme / Simple Ajax Login Form.php
Created May 11, 2017 04:07 — forked from cristianstan/Simple Ajax Login Form.php
Wordpress: Simple Ajax Login Form
<?php
//Simple Ajax Login Form
//Source: http://natko.com/wordpress-ajax-login-without-a-plugin-the-right-way/
//html
<form id="login" action="login" method="post">
<h1>Site Login</h1>
<p class="status"></p>
<label for="username">Username</label>
<input id="username" type="text" name="username">