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 (!empty($settings['works'])) { | |
$i = 0; | |
foreach ( $settings['works'] as $work ) { | |
++$i; | |
?> | |
<div class="col-xs-12 col-sm-6 col-md-5 <?php echo ($i % 2 == 0) ? 'col-md-offset-2' : ''; ?>"> | |
<div class="single-experience"> | |
<div class="date"><?php echo esc_html($work['datetime']) ?></div> | |
<h4 class="title"><?php echo esc_html($work['title']) ?></h4> |
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 (is_array( $faqs )) { | |
$i = 0.2; | |
foreach ( $faqs as $faq ) { | |
?> | |
<div class="col-xs-12 col-sm-6"> | |
<div class="single-faq wow fadeInUp" data-wow-delay="<?php echo $i ?>s"> | |
<h5 class="title"><?php echo esc_html($faq['title']) ?></h5> | |
<p> <?php echo wp_kses_post($faq['description']) ?> </p> | |
</div> |
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 | |
$popular_post = new WP_Query(array( | |
'post_type' => 'post', | |
'posts_per_page' => 5, | |
'meta_key' => 'post_views_count', | |
'orderby' => 'meta_value_num', | |
'order' => 'DESC' | |
)); |
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 post types | |
function skima_post_types() { | |
$post_types = get_post_types([], 'objects'); | |
$posts = array(); | |
foreach ($post_types as $post_type) { | |
$posts[$post_type->name] = $post_type->labels->singular_name; | |
} | |
return $posts; | |
} |
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 prefix_user_role() { | |
$user_meta = get_userdata(get_the_author_meta( 'ID' )); | |
$user_roles = $user_meta->roles; //array of roles the user is part of. | |
echo !empty($user_roles[0]) ? $user_roles[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 | |
// query for your post type | |
$products = new WP_Query( | |
array ( | |
'post_type' => 'product', | |
'posts_per_page' => -1 | |
) | |
); | |
// we need the array of posts | |
$posts_array = $products->posts; |
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 chaoz_icon_array($k) { | |
$v = array(); | |
foreach ($k as $kv) { | |
$kv = str_replace('-', ' ', $kv); | |
$kv = str_replace('icon', '', $kv); | |
$v[] = array_push($v, ucwords($kv)); | |
} | |
foreach($v as $key => $value) if($key&1) unset($v[$key]); | |
return array_combine($k, $v); |
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 | |
$tax_query[] = array( | |
'taxonomy' => 'product_visibility', | |
'field' => 'name', | |
'terms' => 'featured', | |
'operator' => 'IN', // or 'NOT IN' to exclude feature products | |
); | |
// The query | |
$query = new WP_Query( array( | |
'post_type' => '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
<?php | |
// Remove auto p from Contact Form 7 shortcode output | |
add_filter('wpcf7_autop_or_not', 'wpcf7_autop_return_false'); | |
function wpcf7_autop_return_false() { | |
return false; | |
} |
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 | |
// event.pt.php | |
/** | |
* Use namespace to avoid conflict | |
*/ | |
namespace PostType; | |
/** | |
* Class Portfolio |