Skip to content

Instantly share code, notes, and snippets.

View Inzman's full-sized avatar

Indrek Palm Inzman

  • Tartu, Estonia
View GitHub Profile
$tax = 'music';
$oterm = 'pop';
$term = get_term_by('slug', $oterm, $tax);
$termChildren = get_term_children($term->term_id, $tax);
$wp_query = new WP_Query();
$wp_query->query(
array(
'posts_per_page' => '5',
'tax_query' => array(
array(
foreach (array_chunk($users_kicks, 4, true) as $array) {
echo '<div>';
foreach($array as $kicks) {
echo $kicks->brand;
}
echo '</div>';
}
@Inzman
Inzman / gist:37e64ea7d42a3dd13c18a180577b41b3
Created April 5, 2018 10:03
Update WPML translated pages with original language content
<?php
if(is_user_logged_in()){
$args = array(
'sort_order' => 'asc',
'sort_column' => 'post_title',
'post_type' => 'page',
'numberposts' => -1,
'post_status' => 'publish',
'suppress_filters' => false
);
@Inzman
Inzman / gist:fdd709601b7f93a1b2a6576980bc8916
Last active April 5, 2018 08:23
Fix Wordpress slugs to match their titles
<?php
if(is_user_logged_in()){
$args = array(
'sort_order' => 'asc',
'sort_column' => 'post_title',
'post_type' => 'page',
'numberposts' => -1,
'post_status' => 'publish',
'suppress_filters' => false
);