Skip to content

Instantly share code, notes, and snippets.

<?php
/*
Plugin Name: Test
*/
class My_Like_Button {
function __construct()
{
$this->hooks();
}
@fritids
fritids / fadeout.js
Created February 13, 2014 17:01
jQuery fade-out DIV display after certain set time
//#1 http://stackoverflow.com/questions/15118802/jquery-fade-out-div-display-after-certain-set-time
$("#message").fadeIn('slow').delay(5000).fadeOut('slow');
//or http://stackoverflow.com/questions/17677398/hide-a-div-after-5-seconds-or-when-the-user-clicks-the-close-link
$(window).load(function(){
setTimeout(function(){ $('.video-field-new').fadeOut() }, 5000);
});
@fritids
fritids / Count of Post Views (Post View Counter).php
Created February 13, 2014 13:50
Count of Post Views (Post View Counter)
<?php
/***************************************************************************
* Function: Sets, Tracks and Displays the Count of Post Views (Post View Counter)
*********************************************************************************/
//Set the Post Custom Field in the WP dashboard as Name/Value pair
function dp_PostViews($post_ID) {
//Set the name of the Posts Custom Field.
$count_key = 'post_views_count';
$Error
if(count( $errors )==0) echo 'no errors'; else 'some errors';
WP_Error $errors
if(count( $errors->errors )==0) echo 'no errors'; else echo 'some errors';
https://github.com/astockwell/countries-and-provinces-states-regions/blob/master/countries/france.json
@fritids
fritids / profile template inspiration link
Created February 11, 2014 14:34
profile template inspiration link
@fritids
fritids / gridviewlinks
Last active August 29, 2015 13:56
gridview list
<!--- Start : Ajax Auto Complete --->
<script type="text/javascript" src="js/jquery.js"></script>
<script type='text/javascript' src='js/jquery.autocomplete.js'></script>
<link rel="stylesheet" type="text/css" href="css/jquery.autocomplete.css" />
<script type="text/javascript">
$(document).ready(function() {
$("#CountryName").autocomplete("get_countries_list.php", {
width: 260,
matchContains: true,
@fritids
fritids / slectcountrieslinks
Last active August 29, 2015 13:56
select countries and related useful links
<select name="countries">
<option value="USA" selected>United States</option>
<option value="GBR">United Kingdom</option>
<option value="AUS">Australia</option>
<option value="CAN">Canada</option>
<option value="IND">India</option>
<option value="BRA">Brazil</option>
<option value="">-------------------------------</option>
<option value="ALB">Albania</option>
<option value="DZA">Algeria</option>
<?php
// Country code
$countries = array();
$countries[1] = 'Canada (+1)'; // 1 so array doesn't start at 0 and show empty
$countries[] = 'China (+86)';
$countries[] = 'France (+33)';
$countries[] = 'Germany (+49)';
$countries[] = 'India (+91)';
$countries[] = 'Japan (+81)';
$countries[] = 'Pakistan (+92)';