View functions.php
// ACF Pro Options Page(s)
if( function_exists('acf_add_options_page') ) {
$option_page = acf_add_options_page(array(
'page_title' => 'Position Choices',
'menu_title' => 'Position Choices',
'menu_slug' => 'position-choices',
'capability' => 'edit_posts',
'icon_url' => 'dashicons-yes',
'redirect' => false,
View custom-loop.php
<?php $latestNews = new WP_Query( array(
'post_type' => 'post',
'order' => 'ASC',
'orderby' => 'date',
'posts_per_page' => '2'
)); ?>
<?php if( $latestNews->have_posts() ) : ?>
<section class="latest-news">
<h2>latest news</h2>
View manifest.json
{
"dependencies": {
"main.js": {
"files": [
"scripts/main.js"
],
"vendor": [
"assets/scripts/jquery.colorbox-min.js",
"assets/scripts/jQuery.matchHeight.js",
"assets/scripts/slick.min.js"
View white-space.php
<?php echo str_replace(' ', '', get_field('custom_field', 'option')); ?>
View scroll-to.js
// Scroll to element
jQuery(document).ready(function() {
jQuery('.nav-primary a[href^="#"]').click(function() {
var target = jQuery(this.hash);
if (target.length === 0) { target = jQuery('div[id="' + this.hash.substr(1) + '"]');}
if (target.length === 0) { target = jQuery('html');}
jQuery('html, body').animate({ scrollTop: target.offset().top - 0 }, 500);
return false;
});
});
View functions.php
// Hide Product Category Count
add_filter( 'woocommerce_subcategory_count_html', 'hide_subcategory_count' );
function hide_subcategory_count() {
}
View popular-products.php
View Gulp and BrowserSync.txt
Install Gulp globally (if not already installed):
$ npm install gulp -g
Navigate to the project directory, run npm init to setup the project:
$ npm init
Install Gulp to the project:
View functions.php
// Display featured products in shop pages
add_filter( 'woocommerce_product_query_tax_query', 'custom_product_query_tax_query', 10, 2 );
function custom_product_query_tax_query( $tax_query, $query ) {
if( is_admin() ) return $tax_query;
if ( is_shop() ) {
$tax_query[] = array(
'taxonomy' => 'product_visibility',
'field' => 'name',
'terms' => 'featured'
View categories.php
// in the loop
$category = get_the_category();
$currentcat = $category[0]->cat_ID;
$currentcatname = $category[0]->cat_name;
$currentcatslug = $category[0]->slug;
// outside the loop
global $post;
$categories = get_the_category($post->ID);
$currentcat = $category[0]->cat_ID;
$currentcatname = $category[0]->cat_name;