This file contains hidden or 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
SELECT DISTINCT | |
post_title | |
, post_content | |
,(SELECT meta_value FROM wp_postmeta WHERE wp_postmeta.meta_key = 'Asking Price (US\$)' AND wp_postmeta.post_id = wp_posts.ID) as "Asking Price (US\$)" | |
,(SELECT meta_value FROM wp_postmeta WHERE wp_postmeta.meta_key = 'Asking Price (ZAR)' AND wp_postmeta.post_id = wp_posts.ID) as "Asking Price (ZAR)" | |
,(SELECT meta_value FROM wp_postmeta WHERE wp_postmeta.meta_key = 'Author' AND wp_postmeta.post_id = wp_posts.ID) as Author | |
,(SELECT meta_value FROM wp_postmeta WHERE wp_postmeta.meta_key = 'Binding' AND wp_postmeta.post_id = wp_posts.ID) as Binding | |
,(SELECT meta_value FROM wp_postmeta WHERE wp_postmeta.meta_key = 'Book Condition' AND wp_postmeta.post_id = wp_posts.ID) as "Book Condition" | |
,(SELECT meta_value FROM wp_postmeta WHERE wp_postmeta.meta_key = 'Book Number' AND wp_postmeta.post_id = wp_posts.ID) as "Book Number" | |
,(SELECT meta_value FROM wp_postmeta WHERE wp_postmeta.meta_key = 'Book Type' AND wp_postmeta.post_id = wp_posts.ID) as "Book Type" |
This file contains hidden or 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 | |
/* | |
* Loop through a Repeater field | |
*/ | |
if( get_field('repeater') ) | |
{ | |
while( has_sub_field('repeater') ) | |
{ |
This file contains hidden or 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 a field object and display it with it's value | |
*/ | |
$field_name = "text_field"; | |
$field = get_field_object($field_name); | |
echo $field['label'] . ': ' . $field['value']; |
This file contains hidden or 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: Mini Admin Bar | |
* Plugin URI: http://www.netyou.co.il/ | |
* Description: Makes the admin bar a small button on the left and expands on hover. | |
* Version: 1.0 | |
* Author: NetYou | |
* Author URI: http://www.netyou.co.il/ | |
* License: MIT | |
* Copyright: NetYou |
This file contains hidden or 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
function cc_mime_types( $mimes ){ | |
$mimes['svg'] = 'image/svg+xml'; | |
return $mimes; | |
} | |
add_filter( 'upload_mimes', 'cc_mime_types' ); |
This file contains hidden or 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
<link href="touch-icon-iphone.png" rel="apple-touch-icon-precomposed" /> | |
<link href="touch-icon-ipad.png" rel="apple-touch-icon-precomposed" sizes="72x72" /> | |
<link href="touch-icon-iphone4.png" rel="apple-touch-icon-precomposed" sizes="114x114" /> | |
<link href="touch-icon-ipad3.png" rel="apple-touch-icon-precomposed" sizes="144x144" /> |
This file contains hidden or 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
$querystr = " | |
SELECT * FROM $wpdb->posts | |
LEFT JOIN $wpdb->postmeta ON($wpdb->posts.ID = $wpdb->postmeta.post_id) | |
LEFT JOIN $wpdb->term_relationships ON($wpdb->posts.ID = $wpdb->term_relationships.object_id) | |
LEFT JOIN $wpdb->term_taxonomy ON($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) | |
LEFT JOIN $wpdb->terms ON($wpdb->term_taxonomy.term_id = $wpdb->terms.term_id) | |
WHERE $wpdb->terms.name = 'slides' | |
AND $wpdb->term_taxonomy.taxonomy = 'category' | |
AND $wpdb->posts.post_status = 'publish' | |
AND $wpdb->posts.post_type = 'post' |
This file contains hidden or 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
$querystr = " | |
SELECT $wpdb->posts.* | |
FROM $wpdb->posts | |
LEFT JOIN $wpdb->postmeta ON ($wpdb->posts.ID = $wpdb->postmeta.post_id) | |
LEFT JOIN $wpdb->post2cat ON ($wpdb->posts.ID = $wpdb->post2cat.post_id) | |
WHERE $wpdb->postmeta.meta_key = 'paragraf' | |
AND $wpdb->posts.post_status = 'publish' | |
AND $wpdb->posts.post_type = 'post' | |
AND $wpdb->post2cat.category_id IN (1,2,3) | |
ORDER BY $wpdb->postmeta.meta_value ASC |
This file contains hidden or 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 echo_first_image( $postID ) { | |
$args = array( | |
'numberposts' => 1, | |
'order' => 'ASC', | |
'post_mime_type' => 'image', | |
'post_parent' => $postID, | |
'post_status' => null, | |
'post_type' => 'attachment', | |
); |
This file contains hidden or 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
//PUT THIS CODE INTO YOUR functions.php | |
//Creating custom taxonomy: | |
add_action( 'init', 'create__taxonomy' ); | |
function create__taxonomy() { | |
/* ########################################################## | |
* ### 'GALLERY' custom post type related custom taxonomy ### |