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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
// This version works with an ACF with the name 'new' | |
// 1.Displays the tab on every product page | |
add_filter( 'woocommerce_product_tabs', 'woo_new_tab' ); | |
function woo_new_tab( $tabs ) { | |
// Adds the new tab | |
$tabs['new'] = array( | |
'title' => __( 'New', 'woocommerce' ), | |
'priority' => 20, | |
'callback' => 'woo_new_tab_content' | |
); |
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
.tabs-title { | |
float:none !important; | |
display:inline-block; | |
} | |
.tabs { | |
text-align:center; | |
} |
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
//Language Switcher | |
add_filter('wp_nav_menu_items', 'new_nav_menu_items', 10, 2); | |
function new_nav_menu_items($items, $args) { | |
//Places the Language switcher in theme menu location 'languages' | |
if (function_exists('icl_get_languages') && $args->theme_location == 'languages') { | |
$languages = icl_get_languages('skip_missing=0'); | |
//Remove current language and assign language code name class to li item | |
if(!empty($languages)){ | |
foreach($languages as $l){ | |
if(!$l['active']){ |
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 $my_home_url = apply_filters('wpml_home_url', get_option('home')); ?> | |
<a href="<?php echo $my_home_url; ?>">Home</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
// Site URL | |
<?php get_site_url(); ?> | |
// Dynamic Footer Date | |
<?php the_date('Y'); ?> | |
// Featured Image as Background Image | |
<style>.project-card-image{width:200px;height:200px;background-position:center}</style> | |
<?php $projectbg = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'home-campaigns' );?> | |
<div class="project-card-image" style="background-image: url('<?php echo $projectbg['0'];?>');"></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 $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'slideshow' );?> | |
<div style="background-image: url('<?php echo $thumb['0'];?>');" class="large-header-image"> | |
</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
add_action('wp_head','ga_header', 20); | |
function ga_header() { | |
if ( !is_user_logged_in()) { ?> | |
<script> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'UA-XXXXX-Y', 'auto'); |
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 | |
/** | |
* Plugin Name: Custom Collection Plugin | |
* Plugin URI: https://thedigitalconcern.com | |
* Description: Creates a collection custom post type called Objects. | |
* Version: 1.0 | |
* Requires at least: 5.2 | |
* Requires PHP: 7.2 | |
* License: GPL v2 or later | |
* License URI: https://www.gnu.org/licenses/gpl-2.0.html |
OlderNewer