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 this to your theme's functions.php file | |
*/ | |
wpcf7_add_shortcode('sourceurl', 'wpcf7_sourceurl_shortcode_handler', true); | |
function wpcf7_sourceurl_shortcode_handler($tag) { | |
if (!is_array($tag)) return ''; | |
$name = $tag['name']; | |
if (empty($name)) return ''; |
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 | |
/* | |
* run Once class | |
* | |
*/ | |
if (!class_exists('run_once')){ | |
class run_once{ | |
function run($key){ | |
$test_case = get_option('run_once'); | |
if (isset($test_case[$key]) && $test_case[$key]){ |
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 to get terms only if they have posts by post type | |
* @param $taxonomy (string) taxonomy name eg: 'post_tag','category'(default),'custom taxonomy' | |
* @param $post_type (string) post type name eg: 'post'(default),'page','custom post type' | |
* | |
* | |
* Usage: | |
* list_terms_by_post_type('post_tag','custom_post_type_name'); |
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: display_custom_search_form | |
Plugin URI: http://en.bainternet.info | |
Description: display_custom_search_form by shortcode | |
Version: 1.0 | |
Author: Bainternet | |
Author URI: http://en.bainternet.info | |
*/ |
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
#Install the required system packages | |
yum -y install mysql-server httpd php php-mysql unzip wget | |
#update php since WordPress 3.2.1 needs php5.2 and up | |
rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm | |
yum --enablerepo=webtatic install php php-common php-eaccelerator php-mysql php-devel -y | |
#to install git uncomment this next line | |
#yum install --enablerepo=webtatic git-all -y |
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
// The Loop | |
/* | |
* Usage: loop category="news" query="" pagination="false" | |
*/ | |
<?php | |
add_shortcode("loop", "myLoop"); | |
function myLoop($atts, $content = null) { | |
extract(shortcode_atts(array( |
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 | |
define('WYSIWYG_META_BOX_ID', 'my-editor'); | |
define('WYSIWYG_EDITOR_ID', 'myeditor'); //Important for CSS that this is different | |
define('WYSIWYG_META_KEY', 'extra-content'); | |
add_action('admin_init', 'wysiwyg_register_meta_box'); | |
function wysiwyg_register_meta_box(){ | |
add_meta_box(WYSIWYG_META_BOX_ID, __('WYSIWYG Meta Box', 'wysiwyg'), 'wysiwyg_render_meta_box', 'post'); | |
} |
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 comments and comment form as a var | |
global $post; | |
$comments = get_comments('post_id='.$post->ID); | |
$com = ''; | |
foreach($comments as $comment) : | |
$com .= '<div class="com_container"> | |
<div class="com_author">'.$comment->comment_author . '</div> | |
<div class="com_content">' . $comment->comment_content.'</div> | |
</div>'; |
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
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script> | |
<script type="text/javascript" src="/fancybox/lyte_video.jQuery.min.js"></script> |
OlderNewer