Skip to content

Instantly share code, notes, and snippets.

@ahmad24
ahmad24 / gist:7637914
Created November 25, 2013 07:59
Html : main template
We couldn’t find that file to show.
<?php
/*
Plugin Name: Widget Example Plugin
Plugin URI: http://example.com/wordpress-plugins/my-plugin
Description: A plugin to create widgets in WordPress
Version: 1.0
Author: Brad Williams
Author URI: http://wrox.com
License: GPLv2
*/
@ahmad24
ahmad24 / index.html
Last active December 29, 2015 21:39
CSS : Table header rotate
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Responsive Tables</title>
<style>
.cf:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; }
@ahmad24
ahmad24 / action_example.module
Created December 1, 2013 13:15
Drupal : action triggers
<?php
/**
* action_example.info
* name = Action example
* description = Demonstrates providing actions that can be associated to triggers.
* package = Example modules
* core = 7.x
* dependencies[] = trigger
* files[] = action_example.test
* ; Information added by packaging script on 2013-11-04
@ahmad24
ahmad24 / filter_example.module
Created December 1, 2013 13:41
Drupal : add filter short code
<?php
/**
* filter_example.info
* name = Filter example
* description = An example module showing how to define a custom filter.
* package = Example modules
* core = 7.x
* files[] = filter_example.test
*
* ; Information added by packaging script on 2013-11-04
@ahmad24
ahmad24 / custom-filter
Last active December 30, 2015 03:09
wordpress : custom filter
<?php
function boj_posts_by_comments() {
/* Default arguments. */
$args = array(
'post_type' = > 'post',
'posts_per_page' = > 10,
'order' = > 'DESC',
'orderby' = > 'comment_count'
@ahmad24
ahmad24 / db-plugin
Last active December 30, 2015 03:19
wordpress : Dashboard Widget
<?php
/*
Plugin Name: Dashboard Widget Example Plugin
Plugin URI: http://example.com/wordpress-plugins/my-plugin
Description: A plugin to create dashboard widgets in WordPress
Version: 1.0
Author: Brad Williams
Author URI: http://wrox.com
License: GPLv2
*/
@ahmad24
ahmad24 / rss-dashboard-widget
Last active December 30, 2015 03:29
wordpress : RSS Dashboard Widget
<?php
/*
Plugin Name: RSS Dashboard Widget Example Plugin
Plugin URI: http://example.com/wordpress-plugins/my-plugin
Description: A plugin to create dashboard widgets in WordPress
Version: 1.0
Author: Brad Williams
Author URI: http://wrox.com
License: GPLv2
*/
@ahmad24
ahmad24 / mb-login
Last active December 30, 2015 03:49
wordpress : metabox
<?php
/*
Plugin Name: Meta Box Example Plugin
Plugin URI: http://example.com/wordpress-plugins/my-plugin
Description: A plugin to create meta boxes in WordPress
Version: 1.0
Author: Brad Williams
Author URI: http://wrox.com
License: GPLv2
*/
@ahmad24
ahmad24 / form-style
Last active December 30, 2015 03:59
wordpress : setting form style 1
<div class="wrap">
<?php screen_icon( 'plugins' ); ?>
<h2>My Plugin </h2>
<form method="POST" action="">
<table class="form-table">
<tr valign="top">
<th scope="row">
<label for="fname">First Name </label>
</th>
<td>