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 has_grandchildren( $post_id ){ | |
$children = get_children(array( | |
'post_parent' => $post_id | |
)); | |
if( $children ){ | |
foreach( $children as $child ){ | |
$grandchildren = get_children(array( | |
'post_parent' => $child->ID |
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
/* | |
* Modify ACF fields to account for translations if available | |
* | |
* This solution requires the use of Polylang for WP translations. | |
* Use this by duplicating the field groups for user meta and append _languageslug to each field in the duplicated group. | |
* So for a site with a swedish translation an example field would be named "user_phonenumber" | |
* in english (default) and in the swedish translation group "user_phonenumber_sv" | |
*/ | |
function load_translated_value_if_exists( $value, $post_id, $field ){ |
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
{ | |
"repositories": [ | |
{ | |
"type": "composer", | |
"url": "http://wpackagist.org" | |
}, | |
{ | |
"type": "package", | |
"package": { | |
"name": "advanced-custom-fields/advanced-custom-fields-pro", |
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
/* Change this | |
* =============================== | |
*/ | |
// sub fields | |
foreach( $selector as $s ) { | |
if( is_numeric($s) ) { | |
$row_i = intval($s) - 1; | |
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 | |
/* This file is taken directly from a clients site so it contains strings and conditions not necessarily useful to anyone else. | |
However it does show how one can use these filters to modify the meta information for the different filtered results */ | |
/* CHANGE META DESCRIPTION ON KLINIK FILTER PAGES */ | |
add_filter('wpseo_metadesc', 'custom_metadesc', 10, 1); | |
function custom_metadesc($desc){ | |
if(is_tax(array('omrade', 'yrkeskategori', 'specialisering', 'betalningsmedel', 'forsakringsbolag'))){ | |
global $wp_query; | |
$termID = $wp_query->queried_object->term_id; |
NewerOlder