SSH Public Key Based Authentication

Motivation: I want to acces to my Bluehost server from my local computer, make some file copies ‘scp’ but from a script executed by Crontab, so I don’t want to introduce my password manually.
Solution:

  • Generate the key from your local machine (I don’t think it’s needed but, store the keys in ~/.ssh

    1
    
    ssh-keygen -t rsa
    ssh-keygen -t rsa
  • Copy the public key to your server:

    1
    
    scp .ssh/id_rsa.pub username@server_name_address:.ssh/authorized_keys2
    scp .ssh/id_rsa.pub username@server_name_address:.ssh/authorized_keys2

Source: ciberciti

recOblidar

– Uooo! Ei! Uooo, uououooo! Mira, miiira!

– Què tens, què hi ha? – inquiria la mare amb preocupació.

– Mamà, mamà, mamaaaaaaaaaà! – cridava com si s’hagués de morir.

Cridava tant, que vaig haver d’aixecar la cella. No importava en absolut que per agafar aquell vol de Monarch Airlines m’hagués despert a les tres de la matinada. Una fila al davant i dos seients a l’esquerra hi havia aquell nen a punt d’expirar.

– Estem volant per sobre dels núvols. Estem volaaant! – deia el nen a no res de sucumbir.

Perquè certament aquell nen semblava a punt de morir, a punt de morir de vida i fascinació. “Cotó, són de cotó, els vull tocaaar!”.

Vaig somriure. Tímidament, m’havia confessat un secret com si jo mateix fos el meu primer amant. Em vaig avergonyir lleugerament de la parsimònia amb la que havia executat totes i cadascuna de les meves accions: un hola i un somriure barats a l’hostessa, maleta al compartiment de dalt, cinturó ajustat i ulls clucs.
Com pot ser? Però si estàvem volaaant! Volar! I jo concentrat en la rutina… Per sort, la dosi definitiva del medicament d’il·lusió tornava a arribar de la mà d’aquell nen: “això és Menorca! Menorca, mira aquestes pedres, mira l’aigua, mira, mira, mira mamà!” El meu cor donà un salt en veure-ho amb els ulls d’aquell nen. Els pèls de punta el van seguir.

Sempre que transito d’algun lloc a un altre lloc estic eufòric. Exploto d’idees, em sembla que mai més tornaré a dormir. D’alguna manera el trasllat esdevé una ruptura molt explícita de la rutina. L’últim cop que arribava d’Uruguai i tornava a Anglaterra va ser un frenesí d’experiències fantàstiques. No anava gens mal encaminat en Ramón Gómez de la Serna en contar el cas d’aquella persona que “tenia tan mala memòria que un dia es va oblidar de que tenia mala memòria i ho va recordar tot”. Sí, a un li fa gràcia i pensa “que enginyós el tiu!” però potser és més cert del que sembla a primera instància. Potser a vegades cal oblidar que quelcom és avorrit per poder recordar que allò era apassionant. Sí, jo que també sóc un tiu “tope” enginyós ho he anomenat recOblidar (Your search – recOblidar – did not match any documents., si Google no ho troba deu ser que encara no existeix).

Però ara havia fet un Oxford – Menorca i en menys de vint-i-quatre hores estava podrit. Des de fora havia anat seguint una mica les notícies, però ara veient tanta merda i tanta mentida a la tele em vaig ensopir. Vaig plànyer tothom des del racó més humil del meu cor. Com devien estar aquí si jo només amb un temps d’exposició de dues hores ja començava a plorar? Pitjor encara: que passarà si per ells això ja és monotonia?

Pensaràs que aquest cop el canvi d’aires ha fallat. Que he vingut i m’he apagat. Al contrari! Tal vegada sí que en un principi vaig estar apunt de deixar-ho córrer. Aquesta història que t’estic contant ara ja me l’havia comentada a mi mateix. Un ho pensa, s’ho parla i després per què fer l’esforç de compartir-ho? Es tracta d’un consum extra d’energia que un es pot estalviar…

Les experiències poden passar sense pena ni glòria si no s’expliquen. I jo ja m’havia auto-convençut a guardar-me això dins el meu cap. Fins que aleshores la màgia succeeix: en aquest cas ha sigut una cançó (“Estic espantat”, la pots escoltar aquí) el que m’ha donat l’empenta. M’ha fet sortir de l’estat de repòs i ara m’estic dirigint a tu.

Ens donem empentes els uns als altres i ens activem. Però no t’exigiré res, això que et conto només és una oferta pública de suport. No em preocupa si ens coneixem o no. No em preocupa si el que fas no és majestuós, si les teves accions no són messiàniques (fa uns dos mil anys que no crec en un únic messies). Tampoc et premiaré perquè facis alguna cosa bona, perquè no sé què és el bo. L’únic que et puc transmetre és admiració i tot el meu suport si has intentat trencar la monotonia, si has vist quelcom (per petit que sigui) amb ulls de nen…, si has après o vols aprendre que un no ha de defallir mai en matèria d’il·lusions.

He tingut la sort d’aprendre que hi ha quelcom més poderós que creure en un mateix a l’hora d’assolir les fites que un es planteja. Quan algú altri creu que ho pots fer: els límits s’esvaeixen, perquè te’ls havies auto-imposat i ara des de fora et regalen confiança incondicional. T’ho transmeto en forma d’empenta perquè et puguis moure!

[Nota 1: De tota la porqueria que vaig veure a la tele se’n va salvar un programa, que curiosament es diu ‘Salvados’. Acabava amb Mayor Zaragoza dient “yo siempre he puesto el ejemplo de una mujer llamada Rosa Parks. Rosa Parks, una costurera de Montgomery, no se levantó del autobús cuando subió un hombre blanco. Rosa Parks con aquella semilla fue la que movió todo el boicot a los autobuses por parte de los negros en Alabama. Rosa Parks fue la que hizo que un señor llamado Martin Luther King organizara la marcha sobre Washington y dijera ‘he tenido un sueño’ […] porque si somos millones los que damos un paso daremos un gran salto”]

[Nota 2: Especialment un dia com avui, després de tot el que he parlat, tampoc puc deixar de pensar en que tot i que sempre presumeixo de l’amor i el suport incondicional que he rebut per part de la meva família, potser ara mateix no seria ni tan sols capaç d’escriure tot això si no hagués sigut gràcies a la possibilitat d’una educació pública i de qualitat. I en el meu cas no estic exagerant gens ni mica: si he pogut viatjar (i no tan sols amb avió), si puc desfer-me de la monotonia i il·lusionar-me en gran part és gràcies al sistema educatiu en el que he crescut. Queda dit.]

Concurs Culturàlia 5.0

He escrit aquest microrelat pel concurs de Culturàlia 5.0.
Podria ser que per copsar-ne el caràcter cíclic, ja que ara estem fora de context, caldria comentar que el microrelat es publica dins una ‘capsa’ de comentaris associats a la mateixa notícia del diari.
NOTA IMPORTANT: testejat amb Firefox, Chrome i Safari (no IExplorer)
[UPDATE maig 2012: un dels microrelats guanyadors de Culturàlia 5.0]

remove_filter function in WordPress

Motivation: In a specific website I am using the simplex theme. If one tries to place a static page as home instead of the blog, simplex keeps showing the Home page.
Solution: as you can see, people have already reported this. But in the current version of the theme the line is introduced in functions.php and functions are not really overridden, they can be just replaced.
In the codex it is described how to remove actions and filters but it turned out that the solution didn’t work for me. As usually, it was really easy but cost me a bit to figure out:

1
2
3
4
5
6
function unhook_simplex_function() {
    if(has_filter( 'wp_nav_menu_items', 'simplex_nav_menu_items' )){
        remove_filter( 'wp_nav_menu_items', 'simplex_nav_menu_items' );
    }
}
add_action('init','unhook_simplex_function');
function unhook_simplex_function() {
    if(has_filter( 'wp_nav_menu_items', 'simplex_nav_menu_items' )){
        remove_filter( 'wp_nav_menu_items', 'simplex_nav_menu_items' );
    }
}
add_action('init','unhook_simplex_function');

Instead of calling the remove_filter function directly in my functions.php I just added an action that calls the function that will remove the filter from the ‘init’.

WordPress in Spanish

Motivation: it’s pretty simple. I just wanted to create a WordPress site in Spanish.
Solution: download the file from the source specified below. Extract the file es_ES.mo and place it in /wp-content/languages/. Finally, change the file wp-config.php in the root directory to point to Spanish language: define ('WPLANG', 'es_ES');
Source: http://es.wordpress.org

Pandereta

Normalment, després d’un parell de segles d’haver acabat els estudis universitaris, t’envien un avís de que ja pots recollir el teu títol.

El fet que jo estigui vivint a Oxford m’ha suposat vàries dificultats. El títol s’ha de recollir en persona, s’entrega en mà. És una mena de ritual sagrat on un individu allarga braç i et diposita un paper a sobre de la teva mà. Per això és importantíssim que hi siguis present.

Si per limitacions espai-temporals no pots acudir a la transferència universal de coneixements, pots transferir aquest poder a una altra persona, que s’encarregarà de recollir-te el títol. Però ja sabeu que a mi no m’agrada molestar als amics pel simple fet de molestar, i és que a mi m’hauria bastat amb un .pdf…

Després de vàries trucades i tres-cents milions d’e-mails aconsegueixo que m’enviïn el títol a l’ambaixada espanyola ubicada a Londres. I és clar, des d’allà no me la poden enviar directament a Oxford perquè la meva presència física és totalment necessària.

M’ha costat cinc-centes setmanes més trobar un matí (perquè la seva disponibilitat física també és limitadíssima i òbviament no hi pots anar a qualsevol hora) per poder anar a la capital. Cinc-centes setmanes i vuit-centes trucades. Perquè han de ser trucades, és massa vulgar respondre des de cap de les dues adreces d’e-mail que l’ambaixada té disponibles.

Això sí, a cada trucada et recorden que portis el teu passaport o el DNI, ja que serà crucial que et puguis identificar per a tan esperada mediació de saviesa.

Doncs bé, arribo allà. Em demanen el nom i al cap d’uns segons baixa una persona que en un notable acte de fe em lliura el títol. Ni passaport, ni DNI, ni carta de transmissió de poders. A canvi, una rotllana plena de segells d’en Juanca (cinc segells de 2€ per ser més exactes) i el meu matí de transport a la capital.

I és que efectivament som tan afortunats! Vivim en unes condicions especials de transició que ens permeten mantenir el caràcter comparatiu entre dues eres diferents. És una passada… [i aquí que cadascú apliqui el sarcasme o el deixi d’aplicar en funció del seu propi context, perquè a vegades tot plegat “és una passada! :)” i d’altres simplement “és una passada… :(”]

p.d. Post publicat gràcies a la wi-fi del bus Londres-Oxford. Quina passada! ;)

Orphan next post arrow in Safari and Chrome

Motivation: in the single post page, the arrow that points to the next post appears one line below the ‘Next’ text in Safari and Chrome browsers.
Solution: I don’t know if this is a ‘good’ way to solve it or if I should report it somewhere, but as a quick fix I’ve edited my child style.css file adding the following:

1
2
3
4
5
6
#nav-single .nav-next {    
    float:right;
}
#nav-single .nav-previous {
    float:left;
}  
#nav-single .nav-next {    
    float:right;
}
#nav-single .nav-previous {
    float:left;
}  

VIM tab configuration

Motivation: I like to edit files using VIM. In my server (Bluehost) the default configuration makes my ‘tab’ to produce really width spaces and I want it to be the size of 4 spaces.
Solution: I edited a file .vimrc and I placed in my home directory in my server. The content of this file is the following:

1
2
3
4
5
set expandtab
set smartindent
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set smartindent
set tabstop=4
set softtabstop=4
set shiftwidth=4

Password Protect a Directory with .htaccess

Motivation: protect some directories from being accessed without authorisation.
Solution: using the .httaccess file. You just have to configure one and place it into the directory you want to protect. The code inside the file would look something like this:

1
2
3
4
AuthType Basic
AuthName "guest"
AuthUserFile "/home/user/.htpasswds/public_html/directory2storepass/passwd"
require valid-user
AuthType Basic
AuthName "guest"
AuthUserFile "/home/user/.htpasswds/public_html/directory2storepass/passwd"
require valid-user

Then you have to place the password in the directory you have chosen.
The source I’ve used.

wp-cv plugin creation

Motivation: I hate standard text-based CVs. They are so boring and I want something that gives you a quick look into the main things somebody has done. And I also want it to be strongly ‘time-based’. Plus: I want a very very simple design and I need to have a functional version very very soon.
Motivation(II): I want to play a little bit with HTML5, the Canvas and making a WP plugin.
Disclaimer: As I need it to be done immediately because I want to apply for a specific candidature I will be doing stuff without thinking very much on code prettiness. Anyway, I’ll promise it will be an iterative process to I’ll be improving it.
Solution:

  1. Starting point: googling about I found this post. So I must say thanks to Simon Harris, I’ll start based my work on his example.
  2. Changed mouse cursor in mouse EventListeners. I want to have the ‘dragging’, ‘mouseover’ etc. pointers. Example:
    1
    2
    3
    4
    5
    
    if (activities[i].contains(mx, my)) {
        e.target.style.cursor = 'pointer'; // My mouse cursor is in the area of an activity, so I change cursor to 'pointer' style.
        return;
    }
    else e.target.style.cursor = 'auto';
    if (activities[i].contains(mx, my)) {
        e.target.style.cursor = 'pointer'; // My mouse cursor is in the area of an activity, so I change cursor to 'pointer' style.
        return;
    }
    else e.target.style.cursor = 'auto';
  3. For the ‘more information’ area, I want to be able to offer rich text edition. I found this one, Aloha Editor, which I’m going to try.
      Cancelled this step right now. I’ve tried the editor but format was not appearing as I desired and right now I’m not going to spend time on it. Let’s assume we’ll edit information manually adding html format
  4. Once I click on an activity I want to update the ‘More information’ section. I do this using Prototype. Very easy to install (by only including the .js file: <script type="text/javascript" src="js/prototype.js"></script>

    ) and very easy to use (in the activities.js file do something like this

    document.getElementById("information").update("<i>"+MORE_INFO_MSG+"</i>");

    NOTE: I finally chose jQuery because I want to use jQuery sliders as some browsers don’t support “range” input sliders in HTML5 yet. Using Prototype and jQuery leads to some conflicts (which can be solved) but I prefer not to mix them. Usage now would be:

    $("#information").html("<i>"+MORE_INFO_MSG+"</i>");
  5. I want my Activity elements to move across the screen so I will display a slider and I’ll apply a SCREEN_OFFSSET to the X position of my activities. This will do the trick.

Right now I publish it as it is, very ad-hoc. But I had a deadline where I wanted to show it. In fact there is much more ‘automatized’ than what you can see (for example, scrolling in horizontal direction). But I promise I’ll keep working on it and finally integrate it as a WordPress plugin.

Some stuff written in catalan, just a TODO list to myself…
a fer:
– en un futur desplaçar només en horitzontal seleccionant qualsevol punt de sa pantalla (mostrar maneta de drag)
– fer zoom de tots a l’hora
– posar els més antics baix i construir cap amunt (activitats posteriors tenen bases o fonaments amb coses d’abans)
– en un futur posar totes les activitats en transparent menys la seleccionada (hi ha un ctx.globalAlpha, però no mola perquè ho posa tot)
– afegir scrolling de nou

My mistake

A little ‘siesta’ in the bus.
Missed my stop.
“1.8 miles from home, 37 minutes walking”, Google Maps said.
F**k! Ffffuuuuuuu!
“0 ºC”, Google Weather said.
F**k, f**k, f*ck, fuck!
Started jogging, why not?

A car approaches me:

– Excuse me, is this the way to get to Wheatly?

– No sir, I’m afraid it’s the next one!

– You saved my day! – the guy was almost in tears (of happiness, I assume)

Mental note: pay attention whenever you make a mistake, you might be saving someone’s day!

WP-reCAPTCHA: javascript error in pages without submit button

[UPDATE]: it seems that the problemis solved since version 3.1.5 (but I’m not certain if this is version 3.1.5 or since 3.1.6. Anyway, you don’t need to read this post if you are using one of those versions or above.

Motivation: I’m using the WP-reCAPTCHA plugin and there is a javascript error in every page where I didn’t include any post comment box.
Solution: Found here. But I’m copying the solution here anyway:
“In the recaptcha.php page, there’s a function called “save_comment_script”. In the middle of it is a block of code that currently looks like this”

<script type="text/javascript">
var sub = document.getElementById('submit');
document.getElementById('recaptcha-submit-btn-area').appendChild (sub);
document.getElementById('submit').tabIndex = 6;
if ( typeof _recaptcha_wordpress_savedcomment != 'undefined') {
	document.getElementById('comment').value = _recaptcha_wordpress_savedcomment;
}
document.getElementById('recaptcha_table').style.direction = 'ltr';
</script>

Change that code to look like this:

<script type="text/javascript">
if(document.getElementById('submit') != null)
{
	var sub = document.getElementById('submit');
	document.getElementById('recaptcha-submit-btn-area').appendChild (sub);
	document.getElementById('submit').tabIndex = 6;
	if ( typeof _recaptcha_wordpress_savedcomment != 'undefined') {
		document.getElementById('comment').value = _recaptcha_wordpress_savedcomment;
	}
	document.getElementById('recaptcha_table').style.direction = 'ltr';
}
</script>

CoRD – Remote Desktop Protocol

Motivation: I need to connect to from my Mac to a remote desktop which is running a Windows server. I want a tool to be able to do this connection by using RDP (Remote Desktop Protocol).
Solution: I found this software, CoRD, which works better than the Microsoft Remote Desktop Connection for Mac (haven’t tried any others).
Issues: I cannot use the local key ‘Alt’, I still have to figure it out!
[SOLVED]: How silly am I?! Everything works so smooth… What happened is that I’m so used to press on my left ‘Alt’ key (this one doesn’t work once you’re in Windows) but the equivalent in the right hand side words perfectly.

Code Snippet

Note: this post is deprecated, I moved to another plugin, see this new post.

Motivation: I want to publish code into my posts. I’m not really motivated to search or code anything so I’ll go for a plugin this time.

Solution: I found this plugin called “WordPress Code Snippet” which for me it’s okay. Maybe in the future I’ll search for another solution but right now it does the trick.

Two blogs in the same page

Motivation: I want to show 2 blogs in my WordPress site. A quick search on the web reveals that apparently you must install each blog separately, but I don’t want to do so. In fact I don’t need two different blogs, I just want to split posts in two different pages (by category).

Solution: the solution I found consists of using the original posts site for one of the blogs and an extra page (with a specific template) to show the other blog pots. Separation is done by category applied to each post.

  1. Create a Page of Posts template. I’m using a child theme of Twenty Eleven so I just create a pageofposts.phpfile with the code below. Then change the category you want to filter for this blog (blog2).
     
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    
    <?php
    /*
    Template Name: Page Of Posts
    */
     
    // if you are not using this in a child of Twenty Eleven, you need to replicate the html structure of your own theme.
     
    get_header(); ?>
    <div id="primary">
    <div id="content" role="main">
     
    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
        'category_name' => 'antiquarianism, championship', // Change these category SLUGS to suit your use.
        'paged' => $paged
    );
    query_posts($args);
    if( have_posts() ) :?>
     
    <?php twentyeleven_content_nav( 'nav-above' );?>
     
    <?php while ( have_posts() ) : the_post(); ?>
     
    <?php get_template_part( 'content', get_post_format() ); ?>
     
    <?php endwhile; ?>
     
    <?php twentyeleven_content_nav( 'nav-below' ); ?>
     
    <?php else : ?>
    <article id="post-0" class="post no-results not-found">
    <header class="entry-header">
    <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
    </header><!-- .entry-header -->
     
    <div class="entry-content">
    <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
    <?php get_search_form(); ?>
    </div>
    </article>
     
    <?php endif; ?>
     
    </div>
    </div>
     
    <?php get_footer();
    <?php
    /*
    Template Name: Page Of Posts
    */
    
    // if you are not using this in a child of Twenty Eleven, you need to replicate the html structure of your own theme.
    
    get_header(); ?>
    <div id="primary">
    <div id="content" role="main">
    
    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'category_name' => 'antiquarianism, championship', // Change these category SLUGS to suit your use.
    	'paged' => $paged
    );
    query_posts($args);
    if( have_posts() ) :?>
    
    <?php twentyeleven_content_nav( 'nav-above' );?>
    
    <?php while ( have_posts() ) : the_post(); ?>
    
    <?php get_template_part( 'content', get_post_format() ); ?>
    
    <?php endwhile; ?>
    
    <?php twentyeleven_content_nav( 'nav-below' ); ?>
    
    <?php else : ?>
    <article id="post-0" class="post no-results not-found">
    <header class="entry-header">
    <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
    </header><!-- .entry-header -->
    
    <div class="entry-content">
    <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
    <?php get_search_form(); ?>
    </div>
    </article>
    
    <?php endif; ?>
    
    </div>
    </div>
    
    <?php get_footer();

    UPDATE: I finally just filtered it in the index.php file. I'm keeping the code above just in case you want to go for that approach, but what I have really done is to copy the idex.php into my child theme. As the post pages is the home, I have added the following code that omits all the posts from programming category:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    <?php
        $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
        $id_cat_prog = get_cat_ID('programming');
        $args= array(
            'cat' => '-'.$id_cat_prog, 
            'paged' => $paged
        ); 
        query_posts($args);
    ?>
    <?php
        $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
        $id_cat_prog = get_cat_ID('programming');
        $args= array(
            'cat' => '-'.$id_cat_prog, 
            'paged' => $paged
        ); 
        query_posts($args);
    ?>
  2.  
  3. Getting category id. You can just check it from your configuration, but I want to obtain my category id from a category name, so I'm using the function:
     
    1
    
    <?php get_cat_ID( $cat_name ) ?>
    <?php get_cat_ID( $cat_name ) ?>
  4.  
  5. Excluding posts from blog 2 to appear into my feed. I don't want my feed to be updated with posts I place in blog 2. Here I found a list of different WordPress feeds so in my feed address I can filter excluding the category of my second blog posts. By the way, in my case I placed a RSS icon in the menu bar so I manually added the post filter from WP Dashbord (Appearance --> Menus, and edit link from custom option.
     
  6. Once you are in the post view if you click on the 'next' or 'previous' post button by default all the posts (doesn't matter to which category they belong) will appear. But I want only posts of 'my current blog' to appear. To solve this I'm using the next_post_link function to tell that I want to filter next or previous posts by category. You only have to edit a few lines in single.php. Here you have an example:
     
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    
    <?php
    $cat_prog = get_cat_ID('programming');
    $cat_pers = get_cat_ID('personal');
    $cat_wp = get_cat_ID('wordpress');
    $cat_bh = get_cat_ID('bluehost');
    if (in_category($cat_prog)) {
        $cat_filter = $cat_pers;
    }
    elseif (in_category($cat_pers)){
        $cat_filter = $cat_prog.','.$cat_wp.','.$cat_bh;
    } 
    ?>      
    <span class="nav-previous"><?php previous_post_link( '%link', __( '<span class="meta-nav">←</span> Previous', 'twentyeleven' ),FALSE,$cat_filter); ?></span>
    <span class="nav-next"><?php next_post_link( '%link', __( 'Next <span class="meta-nav">→</span>', 'twentyeleven' ),FALSE,$cat_filter ); ?></span>
    <?php
    $cat_prog = get_cat_ID('programming');
    $cat_pers = get_cat_ID('personal');
    $cat_wp = get_cat_ID('wordpress');
    $cat_bh = get_cat_ID('bluehost');
    if (in_category($cat_prog)) {
        $cat_filter = $cat_pers;
    }
    elseif (in_category($cat_pers)){
        $cat_filter = $cat_prog.','.$cat_wp.','.$cat_bh;
    } 
    ?>      
    <span class="nav-previous"><?php previous_post_link( '%link', __( '<span class="meta-nav">←</span> Previous', 'twentyeleven' ),FALSE,$cat_filter); ?></span>
    <span class="nav-next"><?php next_post_link( '%link', __( 'Next <span class="meta-nav">→</span>', 'twentyeleven' ),FALSE,$cat_filter ); ?></span>
  7.  
  8. I want to show a different Archives Page for each blog. In one of them I want to show posts by Year and Month. I used the Collapsing Archives plugin. Of course, I don't want posts from the second blog to be listed here. In order to configure the posts I will show in Archives and their style I created an archives.php file in my child theme. Then you only have to create a new page and apply the new template. Be careful: this plugin also takes into account the 'tags' of the post in order to do the filtering, it treats those tags as if they where post categories. Thus you'll have to exclude them in the options:
     
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    
    <?php
    /*
    Template Name: Archives
    */
    get_header(); ?>
     
    <div id="container">
    <div id="content" role="main">
    <?php the_post(); ?>
    <h1 class="entry-title"><?php the_title(); ?></h1>
    <h2>Archives by Year & Month</h2>
    <?php
    if( function_exists('collapsArch') ) {
      collapsArch('animate=1&inExcludeCat=exclude&inExcludeCats=programming,wordpress,bluehost,code,snippet,widget'); // in my case 'code','snippet' and 'widget' are tags and not categories
    } else {
        wp_get_archives();
    }
    ?>
    </div><!-- #content -->
    </div><!-- #container -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    <?php
    /*
    Template Name: Archives
    */
    get_header(); ?>
    
    <div id="container">
    <div id="content" role="main">
    <?php the_post(); ?>
    <h1 class="entry-title"><?php the_title(); ?></h1>
    <h2>Archives by Year & Month</h2>
    <?php
    if( function_exists('collapsArch') ) {
      collapsArch('animate=1&inExcludeCat=exclude&inExcludeCats=programming,wordpress,bluehost,code,snippet,widget'); // in my case 'code','snippet' and 'widget' are tags and not categories
    } else {
        wp_get_archives();
    }
    ?>
    </div><!-- #content -->
    </div><!-- #container -->
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
     
  9. Finally I wanted to show my programming posts divided by category. Tried to use Collapsing Categories plugin but it won't expand properly. I posted on WordPress forum and I'm currently waiting for any hints on this.And just as a mental note if I finally solve this point: by using this plugin I found another error which is solved here.

 

granito

vive en el fondo del mar
y nada en la superfície del viento,
granito de arena de Uruguay:
¡no te canses de remar!
¡no te quedes sin aliento!
aquí, acá, allí, allá… tu, vos, eres, sos, lo que hay.