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
<div class="post-desc"> | |
<!--Edit Short CODE for the player--> | |
<?php if($post->post_type == 'sermons') { | |
$custom_fields = get_post_custom(get_the_ID()); | |
$my_custom_field = $custom_fields['sermon_download']; | |
foreach ( $my_custom_field as $key => $cck_sermon_link ) { | |
}?> | |
<?php if (!empty($cck_sermon_link)) { | |
$var = apply_filters('the_content', "[embed]" . $cck_sermon_link . "[/embed]"); | |
echo $var;} |
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
/*---------------------------------------------------------------------------------- | |
Add this to functions php file to Return parent page ID or child as else. | |
------------------------------------------------------------------------------------*/ | |
function get_top_parent_page_id() { | |
global $post; | |
if ($post->ancestors) { | |
return end($post->ancestors); | |
} else { |
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
I don't quite get your question but his worth a try, if I am understanding you. Add this function to your functions.php or a related file | |
<pre> | |
function get_excerpt2($count){ | |
$permalink = get_permalink($post->ID); | |
$excerpt = get_the_content(); | |
$excerpt = strip_tags($excerpt); | |
$excerpt = substr($excerpt, 0, $count); | |
$excerpt = substr($excerpt, 0, strripos($excerpt, "")); | |
return $excerpt; |
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
SET @wp_url_old = 'http://oldurl.com', @wp_url_new = 'http://newurl.com'; | |
UPDATE wp_options SET option_value = replace( option_value, @wp_url_old, @wp_url_new ) | |
WHERE option_value LIKE CONCAT( '%', @wp_url_old, '%' ); | |
UPDATE wp_posts SET guid = replace( guid, @wp_url_old, @wp_url_new ); | |
UPDATE wp_posts SET post_content = replace( post_content, @wp_url_old, @wp_url_new ); | |
UPDATE wp_postmeta SET meta_value = replace( meta_value, @wp_url_old, @wp_url_new ); |
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
//* Make Font Awesome available | |
add_action( 'wp_enqueue_scripts', 'enqueue_font_awesome' ); | |
function enqueue_font_awesome() { | |
wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css' ); | |
} | |
/** | |
* Place a cart icon with number of items and total cost in the menu bar. |
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: Your Shipping plugin | |
Plugin URI: http://woothemes.com/woocommerce | |
Description: Your shipping method plugin | |
Version: 1.0.0 | |
Author: WooThemes | |
Author URI: http://woothemes.com | |
*/ |
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 your_shipping_method_init() { | |
if ( ! class_exists( 'WC_Your_Shipping_Method' ) ) { | |
class WC_Your_Shipping_Method extends WC_Shipping_Method { | |
/*---------------------------------------------------------------- | |
Constructor for your shipping class | |
----------------------------------------------------------------*/ | |
public function __construct() { |
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 | |
/** | |
* Custom Loop Add to Cart. | |
* | |
* Template with quantity and ajax. | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly. | |
global $product; |
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
add_filter('woocommerce_package_rates', 'wf_sort_shipping_methods', 10, 2); | |
function wf_sort_shipping_methods($available_shipping_methods, $package) | |
{ | |
// Arrange shipping methods as per your requirement | |
$sort_order = array( | |
'wf_shipping_ups' => array(), | |
'wf_shipping_usps' => array(), | |
'free_shipping' => array(), | |
'local_pickup' => array(), |
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 set_mail_html_content_type() { | |
return 'text/html'; | |
} | |
add_action( 'publish_post', 'author_publish_notice', 10 ,2 ); | |
function author_publish_notice( $ID, $post ) { | |
if( 'post' == $post->post_type ) { | |
return; | |
} |
OlderNewer