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 | |
/** | |
* Display search results in a grid. | |
*/ | |
function my_the_loop_args( $args ) { | |
if ( is_search() ) { | |
$args['context'] = 'grid'; |
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 | |
/** | |
* Up sell product display. Override Woo's woocommerce_upsell_display(). | |
* | |
* @since 2.5.0 | |
*/ | |
public function up_sell() { | |
$args = apply_filters('themeblvd_woocommerce_up_sell_args', array( | |
'posts_per_page' => '-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 | |
/** | |
* Add custom field after current <span class="item-title"> | |
*/ | |
function my_item_info( $output ) { | |
$output .= sprintf( '<span class="tagline">%s.</span>', esc_html( get_post_meta( get_the_ID(), 'my_custom_field', true ) ) ); | |
return $output; | |
} |
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 | |
/** | |
* Change number of related product columns | |
* on single product pages. | |
*/ | |
function my_up_sell_args( $args ) { | |
themeblvd_set_att( 'woo_product_columns', 2 ); | |
return $args; // Pass $args through untouched. |
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 | |
/** | |
* Apply separate footer sync template when WPML | |
* language is French (fr). | |
*/ | |
function my_translated_footer( $config ) { | |
if ( defined( 'ICL_LANGUAGE_CODE' ) && 'fr' === ICL_LANGUAGE_CODE ) { | |
$template = 'your-template-name'; // Put the name of your French template here. |
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 | |
/** | |
* Print labels at the start of a section | |
* in the layout builder. | |
* | |
* @param string $section_id ID of current section. | |
* @param string $layout_id ID of current layout the section is in. | |
* @param array $data All of the section's display opion data. | |
*/ | |
function my_section_top( $section_id, $layout_name, $data ) { |
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 template part option to post display | |
* elements. | |
*/ | |
function my_elements( $elements ) { | |
$option = array( | |
'id' => 'part', | |
'name' => __('Template Part (Optional)'), |
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 | |
themeblvd_loop(array( | |
'query' => 'post_type=portfolio_item&posts_per_page=-1', // Custom query, must be a string unfortunately. | |
'context' => 'showcase', // blog, list, grid, or showcase | |
'display' => 'masonry_filter', // showcase (no pagination), paginated, masonry, or masonry_filter. | |
'filter' => 'portfolio', // What taxonomy the the masonry filter menu uses. | |
'columns' => 2 // Number of columns in showcase. | |
)); |
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 if ( $other_properties_query->have_posts() ) : ?> | |
<?php | |
$counter = 1; // Start counter at 1. | |
$total = $other_properties_query->post_count; // Set total number of posts. | |
?> | |
<h2>Under Construction</h2> | |
<?php themeblvd_open_row(); // Open first row before starting loop. ?> |
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 | |
/** | |
* Create a custom set of column number | |
* selections for the Post Grid element. | |
*/ | |
function my_elements( $elements ) { | |
$elements['post_grid']['options']['columns']['options'] = array( | |
'1' => __( '1 Column' ), | |
'2' => __( '2 Column' ), |