Skip to content

Instantly share code, notes, and snippets.

View tysonchamp's full-sized avatar
🏠
Working from home

Soumya Mondal tysonchamp

🏠
Working from home
View GitHub Profile
# get childs of top menu
$children = get_posts(array('post_type' => 'nav_menu_item', 'nopaging' => true, 'numberposts' => 1, 'meta_key' => '_menu_item_menu_item_parent', 'meta_value' => $item->ID));
@tysonchamp
tysonchamp / wp-config-part.php
Created August 26, 2015 07:40
Define home url and site url in wp-config.php
define('WP_HOME','http://127.0.0.1/chowringhee');
define('WP_SITEURL','http://127.0.0.1/chowringhee');
[mysqld]
interactive_timeout=300
key_cache_block_size=4096
max_heap_table_size=32M
max_join_size=1000000000
max_allowed_packet=268435456
open_files_limit=10000
query_cache_size=32M
thread_cache_size=100
tmp_table_size=32M
<form target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input name="cmd" value="_donations" type="hidden">
<input name="business" value="bllaccounts@buddhistlibrary.org.au" type="hidden">
<input name="currency_code" value="AUD" type="hidden">
<input name="amount" id="amount" type="text">
<?php
if (isset($_POST['generate_csv'])) {
$event_name = $_POST['event'];
$table_name = $_POST['table_name'];
$s_date = $_POST['start_date'];
$e_date = $_POST['end_date'];
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: Important Docs Manager
* Description: Load scripts and styles on specific admin menu pages
* Plugin URI: https://github.com/tysonchamp/
* Version: 1.1
* Author: Tyson
* Author URI: http://fb.com/tysonchampno1
* Licence: Open Source
*/
@tysonchamp
tysonchamp / widgets.php
Created June 23, 2016 13:06
Wordpress custom widgets sample code
<?php // Creating the widget
/**
*
* Follow Us On Social Network Widgets
*
**/
class ub_social extends WP_Widget {
function __construct() {
/*
var lightBoxData = {};
JSONData.forEach(function (item) { // loop through each item in the data set
lightBoxData[item.id] = item; // make each item referencable by the ID data field
});
*/
var route = {};
<?php
//Gather comments for a specific page/post
$comments = get_comments(array(
'post_id' => $post->ID,
'status' => 'approve' //Change this to the type of comments to be displayed
));
?>
<?php foreach( $comments as $comment ){ ?>
<div class="guest-review table-wrapper">
<div class="col-xs-3 col-md-2 author table-cell">