Skip to content

Instantly share code, notes, and snippets.

View javierarques's full-sized avatar

Javier javierarques

View GitHub Profile
@javierarques
javierarques / share-demo-plugin.php
Created May 18, 2014 08:20
Ejemplo de plugin simple
<?php
/*
Plugin Name: Compartir Demo Plugin
Description: Este plugin es un ejemplo de creación de plugin para el postgrado ID3 con el cual se puede compartir un post en las redes sociales
Author: Javier Arques
Version: 1.0
*/
@javierarques
javierarques / app.js
Last active December 15, 2022 21:13
Custom taxonomy dropdown walker
$(".goToCategory").change( function() {
if ( this.options[this.selectedIndex].value !== 0 ) {
location.href = this.options[this.selectedIndex].getAttribute('data-permalink');
}
});
@javierarques
javierarques / functions.php
Last active August 29, 2015 14:02
Function the_weather.Wordpress weather box from openweathermap.org API. The API resutls are cached a day with Wordpress Transient API.
/**
* Returns a cached json object with forecast info of a city
* forecast info from openweathermap.org api
* you need and API key
*
* @param $city string with city name
* @return mixed|string json object with forecast info
*/
function get_city_weather( $city ) {
/**
@javierarques
javierarques / functions.php
Created June 2, 2014 18:50
[Wordpress] Get the term names of a post
/**
* Retrieve a post's terms as a list with specified format.
*
* @since 2.5.0
*
* @param int $id Post ID.
* @param string $taxonomy Taxonomy name.
* @param string $before Optional. Before list.
* @param string $sep Optional. Separate items using this.
* @param string $after Optional. After list.
@javierarques
javierarques / header.php
Created June 13, 2014 10:45
WPML / Wordpress custom switch language menu adapted for Zurb Foundation 5 top bar menu
<?php if ( function_exists('icl_get_languages')):?>
<?php
$languages = icl_get_languages('skip_missing=N');
$active = $languages[ICL_LANGUAGE_CODE];
echo '<li class="has-dropdown"><a href="#">'.
'<i class="icon-'.ICL_LANGUAGE_CODE.' flag"></i>'.
'</a>';
if(!empty($languages)){
echo '<ul class="dropdown">';
@javierarques
javierarques / index.html
Created June 18, 2014 07:45
A Pen by Javier.
<div class="table container">
<div class="table-cell">
<code>display: table-cell;</code>
</div>
</div>
<div class="wrapper container">
<div class="inline-block">
<code>display: inline-block;</code>
</div>
@javierarques
javierarques / index.html
Created June 18, 2014 07:45
A Pen by Javier.
<div class="table container">
<div class="table-cell">
<code>display: table-cell;</code>
</div>
</div>
<div class="wrapper container">
<div class="inline-block">
<code>display: inline-block;</code>
</div>
@javierarques
javierarques / en_US.po
Created June 26, 2014 16:11
Wordpress. Poedit file to translate a theme.
msgid ""
msgstr ""
"Project-Id-Version: THEME\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-06-26 17:38+0100\n"
"PO-Revision-Date: \n"
"Language-Team: TEAM <my@email.com>\n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@javierarques
javierarques / admin.php
Last active August 29, 2015 14:03
CUSTOM ADMIN FILTER: Add taxonomy filter to wp-admin posts listing
/**************************************************************************************
* CUSTOM ADMIN FILTER
* Add taxonomy filter to wp-admin posts listing
**************************************************************************************/
add_action( 'restrict_manage_posts', 'my_restrict_manage_posts' );
function my_restrict_manage_posts() {
global $typenow;
@javierarques
javierarques / _base.scss
Created July 9, 2014 11:00
Chrome fix for background-attachment fixed with Zurb Foundation off-canvas menu
html, body, main{
-webkit-backface-visibility: visible;
height: 100%;
}
// off-canvas fix
.off-canvas-wrap, .inner-wrap{
-webkit-backface-visibility: visible;
}