Step #1 Create a file with name “page-title.php”
You can set a static background image in the else statement, just replace the dotted line with your uploaded image URL:
You can set a static background image in the else statement, just replace the dotted line with your uploaded image URL:
Create file named post-types.php in the mu-plugins (must use) folder:
wp-content/mu-plugins/post-types.php
If You don’t want to use the Custom Post Type’s slug, just paste this snippet in your functions.php and rewrite the post type:
<?php
if( $terms = get_terms( array(
'taxonomy' => 'category', // to make it simple I use default categories
'orderby' => 'name'
) ) ) :
// if categories exist, display the dropdown
echo '<div class="isotope-filter-wrapper">';
echo '<select name="categoryfilter"><option value="">Select category...</option>';
foreach ( $terms as $term ) :
echo '<option value="' . $term->term_id . '">' . $term->name . '</option>'; // ID of the category as an option value
endforeach;
echo '</select>';
echo '</div>';
endif;
?>
// =========================================================================
// REMOVE STOREFRONT PAGE TITLE
// =========================================================================
function storefront_remove_title() {
remove_action( 'storefront_page', 'storefront_page_header' );
}
add_action( 'wp', 'storefront_remove_title' );
Loop WordPress post titles:

You can use these WordPress core functions inside the loop:
the_title(); the_excerpt(); the_content(); the_permalink(); the_post_thumbnail();
Place these PHP functions in your HTML structure and add some line of CSS

// ========================================================================= // ADD CUSTOM IMAGE SIZE // ========================================================================= add_image_size( 'custom-size', 800, 540, array( 'left', 'top' ) ); // Hard crop left top
// =========================================================================
// ADD CLASS TO EXCERPT
// =========================================================================
add_filter( "the_excerpt", "add_class_to_excerpt" );
function add_class_to_excerpt( $excerpt ) {
return str_replace('<p', '<p class="card-text"', $excerpt);
}
// =========================================================================
// REMOVE ACCOUNT AND SEARCH ICON FROM storefront-handheld-footer-bar
// =========================================================================
function jk_remove_handheld_footer_links( $links ) {
unset( $links['my-account'] );
unset( $links['search'] );
return $links;
}
add_filter( 'storefront_handheld_footer_bar_links', 'jk_remove_handheld_footer_links' );
// =========================================================================
// REMOVE STOREFRONT HANDHELD BAR
// =========================================================================
function remove_storefront_handheld_footer_bar() {
remove_action( 'storefront_footer', 'storefront_handheld_footer_bar', 999 );
}
add_action( 'init', 'remove_storefront_handheld_footer_bar' );
// =========================================================================
// MOVE STOREFRONT HANDHELD FOOTER BAR WITH CART ICON TO HEADER
// =========================================================================
add_filter( 'storefront_header', 'storefront_handheld_footer_bar' );
// =========================================================================
// BUTTON SHORTCODE WITH ATTRIBUTES
// =========================================================================
function btn_shortcode( $atts, $content = null ) {
$a = shortcode_atts( array(
'href' => '#',
'text' => ''
), $atts );
return '<a class="btn-cta" href="' . esc_attr($a['href']) . '">' . esc_attr($a['text']) . '</a>';
}
add_shortcode( 'button', 'btn_shortcode' );
// =========================================================================
// ADD PARENT PAGE SLUG TO BODY CLASS
// =========================================================================
function body_class_section($classes) {
global $wpdb, $post;
if (is_page()) {
if ($post->post_parent) {
$parent = end(get_post_ancestors($current_page_id));
} else {
$parent = $post->ID;
}
$post_data = get_post($parent, ARRAY_A);
$classes[] = 'parent-' . $post_data['post_name'];
}
return $classes;
}
add_filter('body_class','body_class_section');
// =========================================================================
// ADD CUSTOM WIDGET - TOP HEADER
// =========================================================================
add_action( 'widgets_init', 'register_new_top_header' );
function register_new_top_header() {
register_sidebar(array(
'id' => 'top-header',
'name' => __( 'Top Header', 'storefront' ),
'description' => __( 'Top Header.', 'storefront' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h4 class="widgettitle">',
'after_title' => '</h4>',
));
}
// =========================================================================
// CREATE FUNCTION FOR TOP HEADER WIDGET
// =========================================================================
function top_header_widget(){
dynamic_sidebar('Top Header');
}
// =========================================================================
// HOOK THE WIDGET BEFORE HEADER
// =========================================================================
add_action( 'storefront_before_header', 'top_header_widget', 2 );
// =========================================================================
//REMOVE SIDEBAR OF STOREFRONT CART PAGE
// =========================================================================
function remove_cart_sidebar_storefront() {
if( is_cart()){
remove_action( 'storefront_sidebar', 'storefront_get_sidebar', 10 );
add_filter( 'body_class', function( $classes ) {
return array_merge( $classes, array( 'page-template-template-fullwidth page-template-template-fullwidth-php ' ) );
} );
}
}
add_action( 'wp', 'remove_cart_sidebar_storefront' );
// =========================================================================
// REMOVE SIDEBAR FROM SINGLE PRODUCT PAGE IN STOREFRONT
// =========================================================================
add_action( 'get_header', 'wpninja_remove_storefront_sidebar' );
function wpninja_remove_storefront_sidebar() {
if ( is_product() ) {
remove_action( 'storefront_sidebar', 'storefront_get_sidebar', 10 );
add_filter( 'body_class', function( $classes ) {
return array_merge( $classes, array( 'page-template-template-fullwidth page-template-template-fullwidth-php ' ) );
} );
}
}
Create a True / False custom field with ACF Pro
Add this to functions.php
// =========================================================================
// FULL WIDTH CHECKBOX
// =========================================================================
function add_full_width_layout(){
if( get_field('full_width') ){
remove_action( 'storefront_sidebar', 'storefront_get_sidebar', 10 );
add_filter( 'body_class', function( $classes ) {
return array_merge( $classes, array( 'page-template-template-fullwidth page-template-template-fullwidth-php ' ) );
} );
}
}
add_action( 'wp', 'add_full_width_layout' );
function remove_storefront_home_sections( $args ) {
remove_action( 'homepage', 'storefront_product_categories', 20 );
remove_action( 'homepage', 'storefront_recent_products', 30 );
remove_action( 'homepage', 'storefront_featured_products', 40 );
remove_action( 'homepage', 'storefront_popular_products', 50 );
remove_action( 'homepage', 'storefront_on_sale_products', 60 );
remove_action( 'homepage', 'storefront_best_selling_products', 70 );
}
add_action( 'wp', 'remove_storefront_home_sections' );
// =========================================================================
// ADD FACEBOOK PIXEL TO WP_HEAD
// =========================================================================
function add_facebook_pixel() { ?>
<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', 'xxxxxxxxxxx');
fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=xxxxxxxxxxx&ev=PageView&noscript=1"
/></noscript>
<!-- End Facebook Pixel Code -->
<?php }
add_action('wp_head', 'add_facebook_pixel');
// =========================================================================
// ADD FACEBOOK CONVERSION EVENT SNIPPET TO THANK YOU PAGE
// =========================================================================
function conversion_tracking_thank_you_page() { ?>
<script>
fbq('track', 'Purchase');
</script>';
<?php }
add_action( 'woocommerce_thankyou', 'conversion_tracking_thank_you_page' );
.your_selector:lang(de) {
display: none !important;
}
<?php
global $post;
$post_slug=$post->post_name;
?>