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 vg_update_timestamp( $post_id ) { | |
$startdate = get_post_meta($post_id, 'cmb_from_textdate', true); //not unix timestamp | |
$enddate = get_post_meta($post_id, 'cmb_till_textdate', true); //not unix timestamp | |
$timestamp_start = strtotime( $startdate ); | |
$timestamp_end = strtotime( $enddate ); | |
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 | |
/** | |
* The idea (advanced version) of using Masonry in WordPress was taken from Sridhar Katakam's blog post (Link Below). | |
* Here we are applying the idea in a different way. In this specific scene, we only need the Masonry goodness on Main Page. | |
* Link - http://sridharkatakam.com/using-masonry-genesis-pinterest-like-layout/ | |
* | |
* NOTE: Here we did not use Masonry Brick for Image and CSS, as done in Sridhar's Tutorial. As, we already done some css | |
* work for .entry and gave it a fixed width; and images in this scene were not featured images or images directly fom post. | |
* |
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 | |
//* Add custom body class to the head | |
add_filter( 'body_class', 'sk_body_class' ); | |
function sk_body_class( $classes ) { | |
if ( is_page_template( 'list-page.php' ) || is_page_template('main-page.php') || is_archive() ) | |
$classes[] = 'masonry-page'; | |
return $classes; |
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 | |
/* | |
This is what I wrote to achieve a pattern where Parent Category shows without count | |
and their respective Child categories shown with count. I am pretty sure that there is some neat | |
way to get this done, but I was not able to find that. Pls mention in comments if you knw any | |
other alternative approach. | |
Ex: | |
Parent |
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 | |
/* | |
Template Name: Edit Listing | |
*/ | |
add_filter('gform_field_value_post_title', 'vg_post_title'); | |
add_filter('gform_field_value_post_content', 'vg_post_content'); | |
add_filter('gform_field_value_post_add', 'vg_post_add'); | |
add_filter('gform_field_value_post_mobile', 'vg_post_mobile'); |
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 | |
/** | |
The inspiration of this comes from - http://www.truelocal.com.au/business-type | |
Visit the link to see what we are aiming at. | |
It's a mix of jQuery Accordion plus Categories from WordPress (both tweaked to suit need). | |
The 'jquery-ui.css' mentioned below can be taken from jQuery's site. |
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 | |
$category = get_the_category(); | |
$category = get_category ($category[0]->cat_ID); | |
if ($category->cat_ID) { | |
if(!$category->category_parent) // if category has NO parent | |
$children = wp_list_categories("orderby=id&depth=0&hide_empty=0&title_li=&child_of=".$category->cat_ID."&echo=0"); | |
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 | |
$cat = get_query_var('cat'); | |
$category = get_category ($cat); | |
if(is_archive()) { | |
?> | |
<div id="bread-cat-list-archive"> | |
<h2><?php echo $category->name; ?></h2> |
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 //* Do not include opening php tag | |
/* | |
Add Conditional of where you want your custom Menu to show (insted of Primary) | |
*/ | |
add_action( 'genesis_header', 'sk_replace_menu_in_primary' ); | |
function sk_replace_menu_in_primary() { | |
if( is_page() ) { // Put your conditional here |
OlderNewer