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 | |
/* | |
Create archive-<cpt name>.php file and put the following code in it | |
*/ | |
/** | |
* Template Name: Classifieds Archive | |
* Description: Used as a page template to show Classifieds archive | |
*/ | |
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 //don't include this php tag while pasting snippet in your functions.php file | |
//to catch & print first image occuring in post content (the_content) via famous 'catch-that-image' | |
/* we could have also used genesis_get_image() to catch the first image instead of 'catch_that_image' script; | |
but genesis_get_image() was actually catching "first uploaded image" instead of "first image occuring in the_content". | |
*/ | |
add_action('genesis_entry_header','image_above_t',7); //to place image above title | |
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 //do not include this php tag | |
add_action ('genesis_after_entry', 'my_custom_loop_func'); | |
function my_custom_loop_func() { | |
if(is_home()) | |
{ | |
global $wp_query; | |
if( 2 == $wp_query->current_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 //do not include this php tag | |
add_filter( 'genesis_post_title_output', 'modified_classi_p_title'); | |
function modified_classi_p_title($title) { | |
global $post; | |
$customcat = '<span id="cat_classi">' . get_the_term_list($post->ID, 'classi_cat') . '</span>'; | |
$title = $customcat . $title; | |
return $title; |
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 | |
/****** | |
* Template Name: Events Archive | |
* Description: Used as a page template to show Events archive | |
*********/ | |
remove_action('genesis_loop', 'genesis_do_loop'); | |
add_action('genesis_loop', 'custom_do_event_loop'); | |
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 | |
/******** | |
* Template Name: Events Archive | |
* Description: Used as a page template to show Events archive | |
*******/ | |
remove_action('genesis_loop', 'genesis_do_loop'); | |
add_action( 'genesis_loop', 'custom_do_events_loop' ); |
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 | |
/*****Creating CPT and Taxos for Events [START]******************/ | |
function my_custom_post_events() { | |
$labels = array( | |
'name' => _x( 'Events', 'post type general name' ), | |
'singular_name' => _x( 'Event', 'post type singular name' ), | |
'add_new' => _x( 'Add New', 'book' ), | |
'add_new_item' => __( 'Add New Event' ), |
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 | |
/** | |
* Template Name: Event's Tag Taxonomy Archive | |
* Description: Used as a page template to show Tag Taxonomy Archive | |
*/ | |
remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop | |
add_action( 'genesis_loop', 'custom_do_loop_two' ); // Add custom loop |
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 | |
/* | |
front page archive | |
**/ | |
//Other necessary code here | |
if ( have_posts() ) : | |
while ( have_posts() ) : the_post(); |