This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| * Plugin Name: Paulund WP List Table Example | |
| * Description: An example of how to use the WP_List_Table class to display data in your WordPress Admin area | |
| * Plugin URI: http://www.paulund.co.uk | |
| * Author: Paul Underwood | |
| * Author URI: http://www.paulund.co.uk | |
| * Version: 1.0 | |
| * License: GPL2 | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function paginglink($query,$records_per_page) | |
| { | |
| $self = $_SERVER['PHP_SELF']; | |
| $stmt = $this->conn->prepare($query); | |
| $stmt->execute(); | |
| $total_no_of_records = $stmt->rowCount(); | |
| $total_no_of_pages = ceil($total_no_of_records / $records_per_page); | |
| if (!empty($_GET['page_no'])) { | |
| $page = $_GET['page_no']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function abc() | |
| { | |
| $a = array(); | |
| while (true) | |
| { | |
| $r = rand(1, 15); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //get all categories then display all posts in each term | |
| $taxonomy = 'std_class_txonomy'; | |
| $param_type = 'category__in'; | |
| $term_args=array( | |
| 'orderby' => 'id', | |
| 'order' => 'asc' | |
| ); | |
| $terms = get_terms($taxonomy,$term_args); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //custom widget tutorial | |
| class Realty_Widget extends WP_Widget | |
| { | |
| function __construct() { | |
| parent::__construct( | |
| 'realty_widget', // Base ID | |
| 'Notice Widget', // Name | |
| array('description' => __( 'Displays your latest listings. Outputs the post thumbnail, title and date per listing')) | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Shortcode Making By: Tanjil Ahmed | |
| PurpleIT | |
| */ | |
| //Shortcode | |
| function box($atts, $content = null) { | |
| ob_start(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Custom Background Function | |
| ============================================================================== | |
| $of_options[] = array( "name" => "Background Images", | |
| "desc" => "Select a background pattern.", | |
| "id" => "custom_bg", | |
| "std" => $bg_images_url."bg0.png", | |
| "type" => "tiles", | |
| "options" => $bg_images, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $args = array( | |
| // Arguments for your query. | |
| ); | |
| // Custom query. | |
| $query = new WP_Query( $args ); | |
| // Check that we have query results. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Add the Meta Box | |
| function add_custom_meta_box() { | |
| add_meta_box( | |
| 'custom_meta_box', // $id | |
| 'Author', // $title | |
| 'show_custom_meta_box', // $callback | |
| 'post', // $page | |
| 'normal', // $context | |
| 'high'); // $priority |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Medium Layout: 1280px. */ | |
| @media only screen and (min-width: 992px) and (max-width: 1200px) { | |
| } | |
| /* Tablet Layout: 768px. */ | |
| @media only screen and (min-width: 768px) and (max-width: 991px) { | |
| } |
NewerOlder