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: Contact Page | |
* | |
* This is the template that displays a contact form. | |
* | |
* @package themename | |
*/ | |
if(isset($_POST['submitted'])) { |
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 | |
// Get the Category | |
$id = get_the_id(); | |
$terms = get_the_terms( $id, 'inventory_category' ); | |
$firstcat = $terms[0]->name; | |
?> |
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="filter"> | |
<h5>Sort: </h5> | |
<?php | |
$cat_args = array( | |
'taxonomy' => 'inventory_category', | |
'parent' => 0, | |
'number' => 10, | |
'hide_empty' => true | |
); | |
$terms = get_terms($cat_args); |
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
$taxonomy = 'inventory_category'; | |
$cat_args = array( | |
'taxonomy' => 'inventory_category', | |
'parent' => 0, | |
'number' => 10, | |
'hide_empty' => true | |
); | |
$terms = get_terms($cat_args); |
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 custom logo support | |
*/ | |
add_theme_support( 'custom-logo' ); |
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
/** | |
* Changes the class on the custom logo in the header.php | |
*/ | |
function helpwp_custom_logo_output( $html ) { | |
$html = str_replace('custom-logo-link', 'navbar-brand', $html ); | |
return $html; | |
} | |
add_filter('get_custom_logo', 'helpwp_custom_logo_output', 10); |
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
<a href="<?php the_permalink(); ?>"> | |
<?php the_post_thumbnail( 'full', array('class' => 'card-img-top')); ?> | |
</a> |
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_action( 'cmb2_admin_init', 'cmb2_sample_metaboxes' ); | |
/** | |
* Define the metabox and field configurations. | |
*/ | |
function cmb2_sample_metaboxes() { | |
// Start with an underscore to hide fields from custom fields list | |
$prefix = '_yourprefix_'; | |
/** |
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
/** | |
* Meta Boxes. | |
*/ | |
require get_template_directory() . '/inc/meta-boxes.php'; |
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 | |
$text = get_post_meta( get_the_ID(), '_yourprefix_text', true ); | |
$email = get_post_meta( get_the_ID(), '_yourprefix_email', true ); | |
$url = get_post_meta( get_the_ID(), '_yourprefix_url', true ); | |
echo esc_html( $text ); | |
echo is_email( $email ); | |
echo esc_url( $url ); | |
?> |