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
// Συνδεση στο hook που ανιχνεύει τις αλλαγές των post status | |
add_action('transition_post_status', 'post_to_list2', 10, 3); | |
function post_to_list2($new_status, $old_status, $post) { | |
// Σε ενα νέο post το post status είναι πάντα draft->publish | |
// Σε ενα ανανεωμένο post το post status είναι πάντα publish->publish | |
if ('publish' === $old_status) | |
return; // new posts only! | |
if ('publish' !== $new_status) |
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
class WooExclude_Walker_Category extends Walker_Category | |
{ | |
/** | |
* Start the element output. | |
* | |
* @see Walker::start_el() | |
* | |
* @since 2.1.0 | |
* | |
* @param string $output Passed by reference. Used to append additional 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
class Extended_Walker_Category extends Walker_Category | |
{ | |
/** | |
* Start the element output. | |
* | |
* @see Walker::start_el() | |
* | |
* @since 2.1.0 | |
* | |
* @param string $output Passed by reference. Used to append additional 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
Στο παράδειγμα που χρησιμοποιώ, έχω συνδέσει τις pages με την category taxonomy.<br/> | |
Επίσης έχει και συνδεση με το polylang (εαν ειναι ενεργοποιημενο, ειδαλλως ολα τα taxonomy terms θεωρουνται στην default language). | |
Στο pages εχω κανει assign 3 terms: homepage-elements, home-slider, galleries, με αντίστοιχα πολυγλωσσικα. | |
1. δημιουργούμε την δομή στο χρήστη (usermeta) που θα κρατήσει το taxonomy term. | |
Για λόγους ευκολίας θα είναι textbox με key "assigned_term" και την τιμή homepage_elements. Ιδανικά θα ήταν ενα dropdown με τα terms ή μια ομαδα checkboxes. | |
Στο functions.php προσθέτουμε τα εξής: |
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
// PREREQUISITES | |
1. Google API Maps Browser Key | |
// NOTE: The following example assumes you are using posts in the front page (like twentyfifteen theme). | |
// Change when needed. | |
// Style.css: | |
Add the direction: | |
.maps { height: 40vh; width: 100%; } |
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 | |
// ... include at the end of functions.php | |
// 1. Add google maps -- REQUIRED GOOGLE MAPS API KEY | |
function wp_google_scripts() { | |
$API_KEY = "AIzaSyAj1hqhXwaUnJDZzisebduqKg2QFsCYCS4"; | |
wp_enqueue_script( 'google-maps-native', "http://maps.googleapis.com/maps/api/js?key=".$API_KEY); | |
} | |
add_action( 'admin_enqueue_scripts', 'wp_google_scripts' ); |
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
global $post; | |
define( 'WP_USE_THEMES', false ); | |
/* Template Name: Price comparison */ | |
/* Page needs to be in EN language */ | |
get_header(); | |
?> | |
<table> | |
<tr> |
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 squash($array, $prefix = '') | |
{ | |
$flat = array(); | |
$sep = "."; | |
if (!is_array($array)) $array = (array)$array; | |
foreach($array as $key => $value) |
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
format MZ | |
entry main:start | |
use16 | |
segment main | |
start: | |
; detect EGA BIOS | |
mov ah, 0x12 | |
mov bl, 0x10 |
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
Why is the answer 5 ? | |
Let’s go through the question again and talk through the result. | |
1 rabbit saw 6 elephants while going to the river. <– Therefore, one animal (the rabbit) is going towards the river. | |
Every elephant saw 2 monkeys going towards the river. <– This is the tricky part, from the sentence it implies each of the 6 elephants saw 2 monkeys going towards the river, hence logically will be 6 x 2 = 12 animals (monkeys) going towards the river. | |
However, the statement does not explicitly say that “Every elephant saw 2 DIFFERENT monkeys…”, therefore implicit rules apply and infer that the 2 monkeys are the same. |
OlderNewer