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
{# | |
# File path : <root>/templates/news/index.twig ( default files of Happy Lager Demo Site ) | |
# News index template | |
# ------------------- | |
# | |
# This template gets loaded when "/news" is requested. | |
# | |
# The page first displays the most recent featured News entry, followed by the | |
# remaining News entries in reverse-chronological order. | |
-#} |
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
<!-- In service file --> | |
public function getFieldType($fieldName='') | |
{ | |
if ($fieldName === '') { | |
return null; | |
} | |
$fieldType = (new Query()) | |
->select(['type']) |
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
=========== Date : Jan 2019 ========== | |
1) Data structure, 1 problem each day on geeksforgeeks | |
2) Js | |
2.1) Event bubbling 3 examples | |
2.2) Webworker https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API ,3 example. | |
3) Play on canvas | |
3.1) canvas game https://github.com/maddyBoy/canvas-game-udemy | |
3.2) Improve the performance , https://www.html5rocks.com/en/tutorials/canvas/performance/ |
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
// preload css in wordpress | |
// add this code in child theme function.php | |
add_filter( 'style_loader_tag', 'preload_css', 10, 2 ); | |
function preload_css( $html, $handle ){ | |
$targetHanlde = array('zuhaus_mikado_child_style'); | |
if( in_array( $handle, $targetHanlde ) ){ |
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 id="root">Hi</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
{% set sponsoredentries = craft.entries({ id: 'not ' ~ entry.id }) | |
.section(["articles", "sneakers"]) | |
.lightswitchFieldHandle(1) | |
.limit(10) | |
%} | |
{% for item in sponsoredentries %} | |
<div class="content"> | |
<p>{{ item.title }}</p> |
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
public function actionSponsoredEntriesPriority() { | |
$this->requireAdmin(); | |
$this->requireAjaxRequest(); | |
$newPriority = craft()->request->getPost('newPriority'); | |
$entryId = craft()->request->getPost('entryId'); | |
$success = false; | |
$message = Craft::t('Any message from controller'); | |
$entries = craft()->entries; |
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 in child theme function.php | |
// For more info : https://codex.wordpress.org/Debugging_in_WordPress | |
// Step 1 : define( 'WP_DEBUG', true ); | |
// Step 2 : define( 'WP_DEBUG_LOG', true ); | |
// Step 3 : Paste the below code in child theme function.php | |
// Step 4 : Call the function as : hb_write_log('lets debug'); | |
// Step 5 : See the logs @ /website-entry-point/wp-content/debug.log ( if there is no file create a one with same name.) | |
if (!function_exists('hb_write_log')) { | |
function hb_write_log($log) { |
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 attribute | |
add_action( 'woocommerce_shop_loop_item_title', 'show_attribute_custom_action', 15 ); | |
function show_attribute_custom_action() { | |
global $product; | |
$sizeAttribute = array_shift( wc_get_product_terms( $product->id, 'pa_size', array( 'fields' => 'names' ) ) ); |
NewerOlder