This file contains 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: I Recommend This | |
* Plugin URI: http://www.harishchouhan.com/personal-projects/i-recommend-this/ | |
* Description: This plugin allows your visitors to simply recommend or like your posts instead of commment it. | |
* Version: 2.1.3 | |
* Author: Harish Chouhan | |
* Author URI: http://www.harishchouhan.com | |
* Author Email: [email protected] | |
* |
This file contains 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
<snippet> | |
<content><![CDATA[<!DOCTYPE html> | |
<!--[if IE 7 ]><html id="ie7" lang="en"><![endif]--> | |
<!--[if IE 8 ]><html id="ie8" lang="en"><![endif]--> | |
<!--[if IE 9 ]><html id="ie9" lang="en"><![endif]--> | |
<!-- BEGIN html --> | |
<html lang="en"> | |
<!-- BEGIN head --> | |
<head> |
This file contains 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: Freshdesk | |
* Plugin URI: http://www.harishchouhan.com/wordpress-plugins/freshdesk/ | |
* Description: Allows you to setup single sign on capabilities between your site and Freshdesk. Create's user accounts on the fly, automatically logs in users. | |
* Version: 1.1 | |
* Author: Harish Chouhan | |
* Author URI: http://www.harishchouhan.com/ | |
* Author Email: [email protected] | |
* License: GPLv2 |
This file contains 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 taxonomies terms links | |
function dot_browse_product_cat() { | |
global $post, $post_id; | |
// get post by post id | |
$post = &get_post($post->ID); | |
// get post type by post | |
$post_type = $post->post_type; | |
// get post type taxonomies | |
$taxonomies = get_object_taxonomies($post_type); |
This file contains 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 restrict_admin() | |
{ | |
if ( ! current_user_can( 'manage_options' ) ) { | |
wp_redirect( site_url() ); | |
exit; | |
} | |
} | |
add_action( 'admin_init', 'restrict_admin', 1 ); |
This file contains 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 | |
// echo get_avatar( $id_or_email, $size, $default, $alt ); | |
echo get_avatar( get_the_author_email(), '128', '/images/no_images.jpg', get_the_author() ); | |
?> |
This file contains 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 dot_most_recommended_posts($numberOf, $before, $after, $show_count, $post_type="showcase" ) { | |
global $wpdb; | |
$request = "SELECT * FROM $wpdb->posts, $wpdb->postmeta"; | |
$request .= " WHERE $wpdb->posts.ID = $wpdb->postmeta.post_id"; | |
$request .= " AND post_status='publish' AND post_type='$post_type' AND meta_key='_recommended'"; | |
$request .= " ORDER BY $wpdb->postmeta.meta_value+0 DESC LIMIT $numberOf"; | |
$posts = $wpdb->get_results($request); |
This file contains 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 | |
$query_top_10_showcase = new WP_Query( | |
array( | |
'post_type' => array( 'showcase' ), | |
'orderby' => 'meta_value', | |
'meta_key' => '_recommended', | |
'paged' => $paged | |
) | |
); |
This file contains 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 | |
$query_top_10_posts = new WP_Query( | |
array( | |
'post_type' => array( 'post' ), | |
'post_status' => 'publish', | |
'orderby' => 'meta_value_num', | |
'meta_key' => '_recommended', | |
'posts_per_page' => 10, | |
'nopaging' => false |
This file contains 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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = array( |
OlderNewer