Skip to content

Instantly share code, notes, and snippets.

# Install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install composer
brew install homebrew/php/composer
### PHPCS
composer global require "squizlabs/php_codesniffer=*"
# Add to your .bash_profile
@ouun
ouun / functions.php
Created February 8, 2018 20:37 — forked from varmais/functions.php
Fetch all latest Wordpress posts when using Polylang plugin
<?php
function get_default_language_posts($query)
{
if ($query->is_main_query() && is_home() && function_exists('pll_languages_list') && !is_admin()) {
$languages = pll_languages_list(array('hide_empty' => 1));
$terms = get_terms('post_translations');
$lang_default = pll_default_language();
$lang_current = pll_current_language();
$post_ids = array();