<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mas que Wordpress - Tutoriales, recursos web, JQuery y PHP, Wordpress , twitter y muchos recursos más &#187; Wordpress</title>
	<atom:link href="http://www.masquewordpress.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.masquewordpress.com</link>
	<description>Tutoriales y recursos web sobre JQuery , PHP, Wordpress , twitter. Aprende diseño web y programación</description>
	<lastBuildDate>Mon, 06 Feb 2012 15:02:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>25 plugins de WordPress para mejorar tu sitio</title>
		<link>http://www.masquewordpress.com/25-plugins-de-wordpress-para-mejorar-tu-sitio/</link>
		<comments>http://www.masquewordpress.com/25-plugins-de-wordpress-para-mejorar-tu-sitio/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 15:02:11 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Recursos]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[plugins wordpress]]></category>

		<guid isPermaLink="false">http://www.masquewordpress.com/?p=1184</guid>
		<description><![CDATA[A día de hoy hay 18,108 plugins de WordPress y cada día surgen decenas de ellos. Un usuario medio de WordPress sin embargo no utiliza más de 10 en su sitio. Hoy les presento algunos de mis favoritos y otros que aunque no los utilizo merecen la pena destacar. En este listado encontraran 25 plugins [...]]]></description>
			<content:encoded><![CDATA[<p>A día de hoy hay 18,108 <a href="http://wordpress.org/extend/plugins/">plugins de WordPress</a> y cada día surgen decenas de ellos. Un usuario medio de WordPress sin embargo no utiliza más de 10 en su sitio. Hoy les presento algunos de mis favoritos y otros que aunque no los utilizo merecen la pena destacar. En este listado encontraran 25 plugins que recomiendo para que elijan cual les conviene más.</p>
<p>Dentro de la gran cantidad de plugins disponibles hoy en día, hay montones que están mal programados y solo sirven para hacer sus sitios más lentos o más fáciles de hackear, por lo que esta bien seguir algunas pautas antes de instalar un nuevo plugin.<br />
<span id="more-1184"></span></p>
<p>Algunas que se me ocurren son:</p>
<ul>
<li><strong>Comprobar la cantidad de descargas del plugin:</strong> No queremos ser conejillos de indias en nuestro sitio web, es mejor buscar un plugin con gran audiencia.</li>
<li><strong>Comprobar última actualización: </strong>Tampoco queremos un plugin que no haya sido actualizado hace 2 años. Eso significa probablemente que ni siquiera sea compatible con nuestro sitio.</li>
<li><strong>Comprobar el rating: </strong>Por último podemos ver si tiene buena acogida por parte de los usuarios antes de decidir probarlo por nuestra cuenta.</li>
</ul>
<p>&nbsp;</p>
<p>Y una vez seguidas estas pautas veamos algunos de los plugins más conocidos y la mayoría de los que he utilizado yo.<strong>¿ Ustedes que plugins utilizan?</strong></p>
<p>&nbsp;</p>
<h2>Plugins para seguridad / SPAM</h2>
<ol>
<li><a href="http://wordpress.org/extend/plugins/akismet/">Akismet</a>: Plugin para combatir el spam con gran efectividad. Para activarlos necesitan <a href="http://www.masquewordpress.com/obtener-clave-api-akismet-gratis/">obtener clave api</a></li>
<li><a href="http://wordpress.org/extend/plugins/block-spam-by-math-reloaded/">Block Spam By Math Reloaded</a>: Añade cuentas matemáticas a sus formularios (login, registro, comentarios, etc)</li>
<li><a href="http://wordpress.org/extend/plugins/wp-security-scan/">WP Security Scan</a>: Buscar archivos maliciosos o que faltan y te da sugerencias de como corregirlos.</li>
</ol>
<h2>Plugins para mejorar el SEO</h2>
<ol>
<li><a href="http://wordpress.org/extend/plugins/wordpress-seo/">WordPress SEO by Yoast</a>: Programa muy completo para manejar las keywords, titles y descriptions de nuestros posts, crear sitemaps, etc.</li>
<li><a href="http://wordpress.org/extend/plugins/all-in-one-seo-pack/">All in One SEO Pack</a>: Otro conocido plugin para manejar SEO parecido al anterior pero con menos funciones.</li>
<li><a href="http://wordpress.org/extend/plugins/headspace2/">HeadSpace2 SEO</a>: Otro plugin para manejar SEO que además incluye estadísticas.</li>
<li><a href="http://wordpress.org/extend/plugins/google-sitemap-generator/">Google XML Sitemaps</a>: Crea sitemaps y los envia a los principales motores de búsqueda</li>
<li><a href="http://wordpress.org/extend/plugins/rb-internal-links/">RB Internal Links</a>: Plugin para crear facilmente links internos al escribir posts.</li>
</ol>
<h2>Plugins para social media</h2>
<ol>
<li><a href="http://wordpress.org/extend/plugins/tweet-old-post/">Tweet old post</a>: Publicar en twitter post antiguos según un intervalo dado.</li>
<li><a href="http://wordpress.org/extend/plugins/share-this/">Sharethis</a>: Plugin para compartir artículos a diferentes redes</li>
<li><a href="http://wordpress.org/extend/plugins/digg-digg/">Digg Digg Social Sharing</a>: Otro plugin para compartir y promocionar tu blog. Conocido por su floating panel</li>
</ol>
<h2>Plugins Formularios y comentarios</h2>
<ol>
<li><a href="http://wordpress.org/extend/plugins/contact-form-7/">Contact Form 7</a> : Para mi gusto el mejor para crear formularios, aunque no el más completo.</li>
<li><a href="http://www.sitesketch101.com/gravity_forms">Gravity Forms</a>: Otro plugin de formularios un poco más completo que el anterior.</li>
<li><a href="http://wordpress.org/extend/plugins/replyme/">Reply Me</a>: Envia emails a los usuarios cuando alguien responde uno de sus comentarios. Ideal para mantener conversaciones activas.</li>
<li><a href="http://disqus.com/welcome/">Disqus</a>: Sistema de comentarios que reemplaza el de wordpress. Requiere registro</li>
<li><a href="http://intensedebate.com/">Intense Debate</a>: Otro sistema parecido a disqus. Require registro</li>
</ol>
<h2>Plugins para mejorar rendimiento</h2>
<ol>
<li><a href="http://wordpress.org/extend/plugins/wp-super-cache/">WP Super Cache</a>: Genera páginas estaticas de tu contenido WordPress que logra que el consumo de CPU sea menor y estas carguen más rapido.</li>
<li><a href="http://wordpress.org/extend/plugins/revision-control/">Revision Control</a>: Te permite modificar el número de revisiones de tus posts a guardar. Ideal para webs con miles de posts.</li>
<li><a href="http://wordpress.org/extend/plugins/w3-total-cache/">W3 Total Cache</a>: Dicen que supera en rendimiento a WP Super cache.</li>
</ol>
<h2>Plugins para traducción o sitios multilenguaje</h2>
<ol>
<li><a href="http://wordpress.org/extend/plugins/qtranslate/">qTranslate</a>: Plugin que te permite crear contenido en varios idiomas</li>
<li><a href="http://wordpress.org/extend/plugins/global-translator/">Global Translator</a>: Plugin que utiliza el traductor de google para mostrar tu contenido en varios idiomas.</li>
</ol>
<h2>Plugins Varios</h2>
<ol>
<li><a href="http://wordpress.org/extend/plugins/wp-pagenavi/">WP-PageNavi</a>: Plugin para sustituir los links de Post Anteriores &#8211; Posts Siguientes por una paginación tal y como tengo en este blog</li>
<li><a href="http://wordpress.org/extend/plugins/buddypress/">Buddypress</a>: Crear una red social nunca fue tan fácil. Instala este plugin y en unos minutos tendrás tu propia red social.</li>
<li><a href="http://wordpress.org/extend/plugins/bbpress/">bbPress</a>: Con bbPress podrás crear un foro en tu sitio WordPress de manera sencilla.</li>
<li><a href="http://wordpress.org/extend/plugins/jetpack/">JetPack de WordPress.com</a> Conjunto de herramientas y estadísticas realizadas por el equipo de WordPress que antes solo estaba disponible para la versión de WordPress.com</li>
<li><a href="http://wordpress.org/extend/plugins/nextgen-gallery/">NextGen Gallery</a>: Plugin para crear galerías de imágenes en tu sitio.</li>
</ol>
<p>Seguro que se me quedan un montón por poner. Por que no dejan en los comentarios sus favoritos y para que los usan así los voy agregando. Saludos!!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/25-plugins-de-wordpress-para-mejorar-tu-sitio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Como incluir scripts en ciertas páginas de WordPress</title>
		<link>http://www.masquewordpress.com/como-incluir-scripts-en-paginas-wordpress/</link>
		<comments>http://www.masquewordpress.com/como-incluir-scripts-en-paginas-wordpress/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 19:33:40 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[functions.php]]></category>
		<category><![CDATA[wp_enqueue]]></category>

		<guid isPermaLink="false">http://www.masquewordpress.com/?p=1186</guid>
		<description><![CDATA[Cuando uno trabaja con templates de WordPress hay ocasiones en las que necesitamos incluir una hoja de estilo o un archivo de javascript. Para incluir dichos archivos de forma correcta WordPress nos brinda las herramientas necesarias que son: wp_enqueue_style : Función para incluir hojas de estilo wp_enqueue_script: Función para incluir scripts Antes de explicar como incluir scripts [...]]]></description>
			<content:encoded><![CDATA[<p>Cuando uno trabaja con templates de WordPress hay ocasiones en las que necesitamos incluir una hoja de estilo o un archivo de javascript. Para incluir dichos archivos de forma correcta WordPress nos brinda las herramientas necesarias que son:</p>
<ul>
<li><a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_style">wp_enqueue_style</a> : Función para incluir hojas de estilo</li>
<li><a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script">wp_enqueue_script</a>: Función para incluir scripts</li>
</ul>
<p><span id="more-1186"></span></p>
<p>Antes de explicar como incluir scripts o hojas de estilo en páginas concretas voy a explicar brevemente como se usan estas funciones para quien no las conozca.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">wp_enqueue_script<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$handle</span><span style="color: #339933;">,</span> <span style="color: #000088;">$src</span><span style="color: #339933;">,</span> <span style="color: #000088;">$deps</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ver</span><span style="color: #339933;">,</span> <span style="color: #000088;">$in_footer</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<ul>
<li><strong>$handle</strong> Es el nombre de nuestro script (no necesariamente del archivo) . Este nombre es obligatorio pero no cobra mucho sentido si no usamos la función <a href="http://codex.wordpress.org/Function_Reference/wp_register_style">wp_register_style</a> o si no hay scripts que dependen de este</li>
<li><strong>$src</strong> es la dirección url de nuestro archivo</li>
<li><strong>$deps</strong> son el archivo o archivos del cual depende nuestro script. Si nuestro script es de jQuery, depende de dicha librería. Por lo que pasaríamos un array con el $handle de jQuery como muestro en el ejemplo a continuación</li>
<li><strong>$ver</strong> es la versión del archivo, pero es opcional</li>
<li><strong>$infooter</strong> Si ponemos este valor a true los scripts se cargaran en el footer y no en el header</li>
</ul>
<p>Podemos cargar un script entonces de la siguiente manera:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">wp_enqueue_script<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'cufon-yui'</span><span style="color: #339933;">,</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'stylesheet_directory'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/js/cufon-yui.js'</span> <span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'jquery'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Para las hojas de estilo es prácticamente igual:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">wp_enqueue_style<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$handle</span><span style="color: #339933;">,</span> <span style="color: #000088;">$src</span><span style="color: #339933;">,</span> <span style="color: #000088;">$deps</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ver</span><span style="color: #339933;">,</span> <span style="color: #000088;">$media</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<ul>
<li><strong>$handle</strong> Es el nombre de nuestra hoja de estilo (no necesariamente del archivo) . Este nombre es obligatorio pero no cobra mucho sentido si no usamos la función <a href="http://codex.wordpress.org/Function_Reference/wp_register_style">wp_register_style</a></li>
<li><strong>$src</strong> es la dirección url de nuestro archivo</li>
<li><strong>$deps</strong> son el archivo o archivos del cual depende nuestra hoja de estilo.</li>
<li><strong>$ver</strong> es la versión del archivo, pero es opcional</li>
<li><strong>$media</strong> es el medio destinado como screen , print, <a href="http://www.w3.org/TR/CSS2/media.html#media-types">etc</a></li>
</ul>
<h4>Ahora veamos como incluir un script o hoja de estilo en una sola página.</h4>
<p>Si hemos creado un archivo de jQuery para un formulario que hemos echo nosotros , no queremos que dicho archivo se cargue en todas las páginas de wordpress ya que sería en vano.<br />
Para cargarlo en un página en concreto sin embargo necesitaremos usar un <a href="http://codex.wordpress.org/Plugin_API/Action_Reference">action hook</a> ya que de por si la función <strong>is_page() no funciona dentro de functions.php</strong></p>
<p>Si nuestra página es por ejemplo <strong>http://www.masquewordpress.com/ayuda</strong> deberemos hacer lo siguiente:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> mqw_scripts_paginas<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>is_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ayuda'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> wp_enqueue_script<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'forms'</span><span style="color: #339933;">,</span>get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'stylesheet_directory'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/js/forms.js'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'jquery'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'template_redirect'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'mqw_scripts_paginas'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Básicamente lo que hacemos es llamar a la función is_page una vez que los archivos del template han sido cargados para que así funcione correctamente.</p>
<p>Espero que les haya servido de ayuda. Saludos!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/como-incluir-scripts-en-paginas-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Como activar tus plugins de WordPress automáticamente</title>
		<link>http://www.masquewordpress.com/activar-plugins-wordpress-automaticamente/</link>
		<comments>http://www.masquewordpress.com/activar-plugins-wordpress-automaticamente/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 13:25:12 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[plugins wordpress]]></category>
		<category><![CDATA[tips de wordpress]]></category>

		<guid isPermaLink="false">http://www.masquewordpress.com/?p=1182</guid>
		<description><![CDATA[Si por algún motivo queremos activar plugins automáticamente ya sea porque estamos creado un theme de wordpress que requiera ciertos plugins o por cualquier otro motivo, lo podemos usar modificando la tabla options de WordPress, más concretamente dentro de dicha tabla activate_plugins. Para ello hay que tener en cuenta que necesitaremos el nombre del archivo del [...]]]></description>
			<content:encoded><![CDATA[<p>Si por algún motivo queremos activar plugins automáticamente ya sea porque estamos creado un theme de wordpress que requiera ciertos plugins o por cualquier otro motivo, lo podemos usar modificando la tabla <strong><em>options </em></strong>de WordPress, más concretamente dentro de dicha tabla <em><strong>activate_plugins.</strong></em></p>
<p>Para ello hay que tener en cuenta que necesitaremos el nombre del archivo del plugin y no su nombre. Por ejemplo para activar <a href="http://www.masquewordpress.com/obtener-clave-api-akismet-gratis/">Akismet</a> necesitaremos saber que el archivo se llama <em><strong>&#8216;akismet/akismet.php&#8217;.</strong></em></p>
<p><span id="more-1182"></span></p>
<p>Para obtener un listado de los nombres de archivos de sus plugin pueden usar esta función de manera temporal. Para ello colóquenla en functions.php y refresquen una vez cualquier página de su sitio para ver los resultados.</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'plugin_row_meta'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'fb_get_plugin_string'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> fb_get_plugin_string<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$plugin_meta</span><span style="color: #339933;">,</span> <span style="color: #000088;">$plugin_file</span><span style="color: #339933;">,</span> <span style="color: #000088;">$plugin_data</span><span style="color: #339933;">,</span> <span style="color: #000088;">$status</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// imprime el nombre del archivo</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;code&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$plugin_file</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/code&gt;&lt;br&gt;'</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$plugin_meta</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>&nbsp;<br />
Una vez tengamos nuestros nombre de archivos podemos usarlos para activar los plugins automáticamente:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'admin_init'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'fb_activate_plugins'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//función que activa los plugins</span>
<span style="color: #000000; font-weight: bold;">function</span> fb_activate_plugins<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> current_user_can<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'activate_plugins'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
		wp_die<span style="color: #009900;">&#40;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'No tienes permisos suficientes.'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$plugins</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$plugins</span> <span style="color: #339933;">=</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'active_plugins'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// obtenemos los plugins ya activados</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$plugins</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// array de plugins para activar</span>
		<span style="color: #000088;">$pugins_to_active</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
			<span style="color: #0000ff;">'hello.php'</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Hello Dolly</span>
			<span style="color: #0000ff;">'adminimize/adminimize.php'</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// Adminimize</span>
			<span style="color: #0000ff;">'akismet/akismet.php'</span> <span style="color: #666666; font-style: italic;">// Akismet</span>
		<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #666666; font-style: italic;">// si no estan activados los agregamos al listado de plugins y actualizamos</span>
		<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$pugins_to_active</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$plugin</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$plugin</span><span style="color: #339933;">,</span> <span style="color: #000088;">$plugins</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #990000;">array_push</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$plugins</span><span style="color: #339933;">,</span> <span style="color: #000088;">$plugin</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				update_option<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'active_plugins'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$plugins</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span> 
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Con eso ya podremos activar los plugins que queramos de forma automática. Saludos!!!</p>
<p>Via: http://wpengineer.com/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/activar-plugins-wordpress-automaticamente/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mostrar la cantidad de usuarios registrados en tu sitio WordPress</title>
		<link>http://www.masquewordpress.com/mostrar-la-cantidad-de-usuarios-registrados-en-tu-sitio-wordpress/</link>
		<comments>http://www.masquewordpress.com/mostrar-la-cantidad-de-usuarios-registrados-en-tu-sitio-wordpress/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 18:11:18 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[shortcode]]></category>
		<category><![CDATA[tips de wordpress]]></category>
		<category><![CDATA[usuarios]]></category>

		<guid isPermaLink="false">http://www.masquewordpress.com/?p=1175</guid>
		<description><![CDATA[Si tienen habilitado el registro de usuarios en su sitio WordPress pueden usar este pequeño tip de WordPress para mostrar el total de usuarios. Lo puede aplicar en cualquier sitio o crear un shortcode para usar en sus posts. El código es el siguiente: global $wpdb; $usuarios_totales = $wpdb-&#62;get_var&#40;&#34;SELECT COUNT(ID) FROM $wpdb-&#62;users&#34;&#41;; echo $usuarios_totales.&#34; usuarios [...]]]></description>
			<content:encoded><![CDATA[<p>Si tienen habilitado el registro de usuarios en su sitio WordPress pueden usar este pequeño tip de WordPress para mostrar el total de usuarios. Lo puede aplicar en cualquier sitio o crear un shortcode para usar en sus posts.<br />
<span id="more-1175"></span></p>
<p>El código es el siguiente:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$usuarios_totales</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_var</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT COUNT(ID) FROM <span style="color: #006699; font-weight: bold;">$wpdb-&gt;users</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$usuarios_totales</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; usuarios registrados.&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Para crear un shortcode tan solo deben incluirlo dentro de una función:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> mqw_usuarios_totales<span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$usuarios_totales</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_var</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT COUNT(ID) FROM <span style="color: #006699; font-weight: bold;">$wpdb-&gt;users</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$usuarios_totales</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; usuarios registrados.&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
add_shortcode<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'total_usuarios'</span> <span style="color: #339933;">,</span> <span style="color: #0000ff;">'mqw_usuarios_totales'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Y luego pueden incluirlo en cualquier post de la siguiente manera:<br />
<code>[total_usuarios]</code></p>
<p>Espero que les haya gustado. Saludos!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/mostrar-la-cantidad-de-usuarios-registrados-en-tu-sitio-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cambiar el tamaño del excerpt según la categoría</title>
		<link>http://www.masquewordpress.com/cambiar-el-tamano-del-excerpt-segun-la-categoria/</link>
		<comments>http://www.masquewordpress.com/cambiar-el-tamano-del-excerpt-segun-la-categoria/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 15:20:00 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[excerpt]]></category>
		<category><![CDATA[tips de wordpress]]></category>

		<guid isPermaLink="false">http://www.masquewordpress.com/?p=1167</guid>
		<description><![CDATA[Terminando con la serie de tips de wordpress sobre el excerpt les traigo una forma para cambiar el tamaño del excerpt que podrán adaptar para cambiar el tamaño del mismo según la categoría que se muestre. Para ello hay que usar el filtro de wordpress llamado excerpt_length al cual le podemos pasar cualquier valor que [...]]]></description>
			<content:encoded><![CDATA[<p>Terminando con la serie de <a href="http://www.masquewordpress.com/tag/tips-de-wordpress/">tips de wordpress</a> sobre el <a href="http://www.masquewordpress.com/tag/excerpt/">excerpt</a> les traigo una forma para cambiar el tamaño del excerpt que podrán adaptar para cambiar el tamaño del mismo según la categoría que se muestre.<br />
<span id="more-1167"></span></p>
<p>Para ello hay que usar el filtro de wordpress llamado <strong>excerpt_length</strong> al cual le podemos pasar cualquier valor que queramos.<br />
Por ejemplo para cambiar el tamaño de nuestro excerpt a 40 debemos hacer lo siguiente:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'excerpt_length'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mqw_largo_excerpt'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> mqw_largo_excerpt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$largo</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
           <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">40</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>En cambio si queremos tener un diferente tamaño para cada categoría tan solo necesitaremos los id de las categorías y hacer lo siguiente:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'excerpt_length'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mqw_largo_excerpt'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> mqw_largo_excerpt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$largo</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>in_category<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Les gusto este truco? Espero que si!! Saludos!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/cambiar-el-tamano-del-excerpt-segun-la-categoria/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comprobar si el post tiene excerpt</title>
		<link>http://www.masquewordpress.com/comprobar-si-el-post-tiene-excerpt/</link>
		<comments>http://www.masquewordpress.com/comprobar-si-el-post-tiene-excerpt/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 15:08:28 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[excerpt]]></category>
		<category><![CDATA[tips de wordpress]]></category>

		<guid isPermaLink="false">http://www.masquewordpress.com/?p=1163</guid>
		<description><![CDATA[Siguiendo con la serie de tips de wordpress sobre el excerpt , hoy les traigo una forma de comprobar si el post tiene o no excerpt en caso de que queramos mostrar algo diferente. Para ello tan solo hacemos : &#60;?php if&#40;!empty&#40;$post-&#62;post_excerpt&#41;&#41; &#123; // El post tiene excerpt , y lo mostramos the_excerpt&#40;&#41;; &#125; else [...]]]></description>
			<content:encoded><![CDATA[<p>Siguiendo con la serie de tips de wordpress sobre el <a href="http://www.masquewordpress.com/tag/excerpt/">excerpt</a> , hoy les traigo una forma de comprobar si el post tiene o no excerpt en caso de que queramos mostrar algo diferente.<br />
<span id="more-1163"></span></p>
<p>Para ello tan solo hacemos :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #666666; font-style: italic;">// El post tiene excerpt , y lo mostramos</span>
     the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #666666; font-style: italic;">// El post no tiene, que hacemos?</span>
 <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Espero que les haya sido de utilidad!! Saludos!!</p>
<p>Via: <a href="http://www.wprecipes.com/how-to-check-out-if-a-post-has-an-excerpt" rel="nofollow">Wprecipes</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/comprobar-si-el-post-tiene-excerpt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quitar [...] del excerpt de wordpress</title>
		<link>http://www.masquewordpress.com/quitar-del-excerpt-de-wordpress/</link>
		<comments>http://www.masquewordpress.com/quitar-del-excerpt-de-wordpress/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 15:02:55 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[excerpt]]></category>
		<category><![CDATA[tips de wordpress]]></category>

		<guid isPermaLink="false">http://www.masquewordpress.com/?p=1161</guid>
		<description><![CDATA[Los tengo un poco abandonados con los Tips de WordPress , pero este año empezó con mucho trabajo y últimamente no tengo tiempo. Recuerden que si quieren colaborar lo pueden hacer enviando sus tips de wordpress. Y si están bien redactados y el tip es original lo publico con un link a vuestra web. Y [...]]]></description>
			<content:encoded><![CDATA[<p>Los tengo un poco abandonados con los Tips de WordPress , pero este año empezó con mucho trabajo y últimamente no tengo tiempo. Recuerden que si quieren colaborar lo pueden hacer <a href="http://www.masquewordpress.com/envianos-tu-tip-de-wordpress/">enviando sus tips de wordpress</a>. Y si están bien redactados y el tip es original lo publico con un link a vuestra web.</p>
<p>Y ahora volviendo a tema, cuando queremos quitar [...] del extracto o excerpt que wordpress inserta automáticamente tan solo debemos hacer lo siguiente:<br />
<span id="more-1161"></span></p>
<p>En functions.php colocamos:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> mqw_trim_excerpt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #990000;">rtrim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'[...]'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'get_the_excerpt'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mqw_trim_excerpt'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Saludos, espero que les haya sigo útil!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/quitar-del-excerpt-de-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detectar pais, provincia y ciudad de procedencia mediante la IP</title>
		<link>http://www.masquewordpress.com/detectar-pais-provincia-y-ciudad-mediante-ip/</link>
		<comments>http://www.masquewordpress.com/detectar-pais-provincia-y-ciudad-mediante-ip/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 19:08:01 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Recursos]]></category>
		<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[iplocation]]></category>
		<category><![CDATA[tips de wordpress]]></category>

		<guid isPermaLink="false">http://www.masquewordpress.com/?p=1154</guid>
		<description><![CDATA[El tip de wordpress de hoy es para poder detectar y mostrar la ubicación de sus visitantes mediante la dirección IP de los mismos. Aunque este tip puede usarse para cualquier otro proyecto, hoy les voy a enseñar como integrarlo en wordpress. Si todo es correcto, tu mi querido usuario deber estar ubicado en: Para [...]]]></description>
			<content:encoded><![CDATA[<p>El tip de wordpress de hoy es para poder detectar y mostrar la ubicación de sus visitantes mediante la dirección IP de los mismos. Aunque este tip puede usarse para cualquier otro proyecto, hoy les voy a enseñar como integrarlo en wordpress.</p>
<p>Si todo es correcto, tu mi querido usuario deber estar ubicado en: -, -</p>
<p><span id="more-1154"></span></p>
<p>Para ello vamos primero a crear un shortcode llamado &#8220;iplocation&#8221; que usaremos para mostrar los datos. Para ello en nuestro functions.php copiamos la siguiente función:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> mqw_iplocation<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$atts</span> <span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">null</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> mqw_iplocation_func<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REMOTE_ADDR'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_shortcode<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'iplocation'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mqw_iplocation'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Por último la función que devuelve la ubicación mediante IP. Esta función la saque de http://snipplr.com/view/48386/detect-location-by-ip-city-state/ que usa un servicio gratuito llamado http://ipinfodb.com/ aunque existen de pago y mejores (más exactitud de los datos y mayor actualización de las IP).</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> mqw_iplocation_func<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ip</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000088;">$default</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Mar del Plata, Bs As, Argentina'</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_string</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ip</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ip</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$ip</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'127.0.0.1'</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$ip</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'localhost'</span><span style="color: #009900;">&#41;</span>
            <span style="color: #000088;">$ip</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'8.8.8.8'</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$curlopt_useragent</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)'</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://ipinfodb.com/ip_locator.php?ip='</span> <span style="color: #339933;">.</span> <span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ip</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$curl_opt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
            CURLOPT_FOLLOWLOCATION  <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
            CURLOPT_HEADER      <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span>
            CURLOPT_RETURNTRANSFER  <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
            CURLOPT_USERAGENT   <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$curlopt_useragent</span><span style="color: #339933;">,</span>
            CURLOPT_URL       <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$url</span><span style="color: #339933;">,</span>
            CURLOPT_TIMEOUT         <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
            CURLOPT_REFERER         <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'http://'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_HOST'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #990000;">curl_setopt_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> <span style="color: #000088;">$curl_opt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_null</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl_info</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$curl_info</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_getinfo</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'{&lt;li&gt;City : ([^&lt;]*)&lt;/li&gt;}i'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #000088;">$regs</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$city</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$regs</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'{&lt;li&gt;State/Province : ([^&lt;]*)&lt;/li&gt;}i'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #000088;">$regs</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$state</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$regs</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'{&lt;li&gt;Country : ([^&lt;]*)&lt;/li&gt;}i'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #000088;">$regs</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$country</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$regs</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$city</span><span style="color: #339933;">!=</span><span style="color: #0000ff;">''</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$state</span><span style="color: #339933;">!=</span><span style="color: #0000ff;">''</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$country</span> <span style="color: #339933;">!=</span><span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
          <span style="color: #000088;">$location</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$city</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">', '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$state</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">', '</span><span style="color: #339933;">.</span> <span style="color: #000088;">$country</span><span style="color: #339933;">;</span>
          <span style="color: #b1b100;">return</span> <span style="color: #000088;">$location</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
          <span style="color: #b1b100;">return</span> <span style="color: #000088;">$default</span><span style="color: #339933;">;</span> 
        <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Espero que les haya gustado. Saludos!!</p>
<p>Ahh me olvidaba, tan solo tienen que usar el shortcode de la siguiente manera:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009900;">&#91;</span>iplocation<span style="color: #009900;">&#93;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/detectar-pais-provincia-y-ciudad-mediante-ip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Como mejorar la función the_excerpt() de WordPress</title>
		<link>http://www.masquewordpress.com/como-mejorar-la-funcion-the_excerpt-de-wordpress/</link>
		<comments>http://www.masquewordpress.com/como-mejorar-la-funcion-the_excerpt-de-wordpress/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 17:16:39 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[excerpt]]></category>
		<category><![CDATA[tips de wordpress]]></category>

		<guid isPermaLink="false">http://www.masquewordpress.com/?p=1149</guid>
		<description><![CDATA[Hoy les traigo un tip de wordpress que sirve para mejorar la función the_excerpt() de wordpress que es la encargada de mostrar un extracto de nuestro post. El tamaño del extracto viene predefinido, con la siguiente función podremos cambiar eso de forma variable y elegir un tamaño de excerpt diferente siempre que lo necesitemos. Primero [...]]]></description>
			<content:encoded><![CDATA[<p>Hoy les traigo un tip de wordpress que sirve para mejorar la función the_excerpt() de wordpress que es la encargada de mostrar un extracto de nuestro post. El tamaño del extracto viene predefinido, con la siguiente función podremos cambiar eso de forma variable y elegir un tamaño de excerpt diferente siempre que lo necesitemos.</p>
<p><span id="more-1149"></span><br />
Primero añadimos en functions.php lo siguiente</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Función que imprime el excerpt.</span>
<span style="color: #000000; font-weight: bold;">function</span> print_excerpt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// length es la cantidad máxima de caracteres a msotrar</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$post</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_excerpt</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">''</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$text</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> get_the_content<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">']]&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">']]&gt;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> strip_shortcodes<span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// opcional pero recomendado que quita los shortcodes</span>
	<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strip_tags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// usar ' $text = strip_tags($text,'&lt;p&gt;&lt;a&gt;'); ' si se quieren dejar algunas etiquetas.</span>
&nbsp;
	<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #000088;">$length</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$excerpt</span> <span style="color: #339933;">=</span> reverse_strrchr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'.'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$excerpt</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_excerpt'</span><span style="color: #339933;">,</span><span style="color: #000088;">$excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">echo</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_excerpt'</span><span style="color: #339933;">,</span><span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> reverse_strrchr<span style="color: #009900;">&#40;</span><span style="color: #000088;">$haystack</span><span style="color: #339933;">,</span> <span style="color: #000088;">$needle</span><span style="color: #339933;">,</span> <span style="color: #000088;">$trail</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #990000;">strrpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$haystack</span><span style="color: #339933;">,</span> <span style="color: #000088;">$needle</span><span style="color: #009900;">&#41;</span> ? <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$haystack</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #990000;">strrpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$haystack</span><span style="color: #339933;">,</span> <span style="color: #000088;">$needle</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$trail</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Para usarlo tan solo llamamos a la función de la siguiente forma.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> print_excerpt<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Espero que les haya servido!!Saludos!</p>
<p>Via: <a href="http://www.distractedbysquirrels.com/blog/wordpress-improved-dynamic-excerpt/" rel="nofollow">Sebastian</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/como-mejorar-la-funcion-the_excerpt-de-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Como mostrar los campos de perfil de buddypress en tu template</title>
		<link>http://www.masquewordpress.com/como-mostrar-los-campos-de-perfil-de-buddypress-en-tu-template/</link>
		<comments>http://www.masquewordpress.com/como-mostrar-los-campos-de-perfil-de-buddypress-en-tu-template/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 23:30:35 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Tutoriales]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[buddypress]]></category>
		<category><![CDATA[tips de wordpress]]></category>

		<guid isPermaLink="false">http://www.masquewordpress.com/?p=1142</guid>
		<description><![CDATA[Buddypress es el plugin por excelencia para crear redes sociales en WordPress. A pesar de esto aún es muy joven y fallan en muchas cosas, por ejemplo en la documentación que es escasa y en algunos casos incorrecta  esta obsoleta. Algo que me costo mucho encontrar en su día fue una manera de mostrar la [...]]]></description>
			<content:encoded><![CDATA[<p>Buddypress es el plugin por excelencia para crear redes sociales en WordPress. A pesar de esto aún es muy joven y fallan en muchas cosas, por ejemplo en la documentación que es escasa y en algunos casos <del>incorrecta </del> esta obsoleta. Algo que me costo mucho encontrar en su día fue una manera de mostrar la información de los campos de perfil de un usuario.</p>
<p><span id="more-1142"></span><br />
Buddypress utiliza xprofile o extended profiles fields que no es más que otra forma de agregar información adicional al perfil de WordPress. Suponiendo que tenemos un campo al que llamamos &#8220;deporte favorito&#8221; y queremos mostrarlo. Tan solo necesitaremos hacer lo siguiente:</p>
<p>&nbsp;</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> bp_get_profile_field_data<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'field=deporte favorito'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>En caso de estar fuera de una página de usuario como &#8220;/members/admin&#8221; necesitaremos pasarle una id de usuario. Por ejemplo del autor del post que estamos viendo.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> bp_get_profile_field_data<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'field=deporte favorito&amp;user_id='</span><span style="color: #339933;">.</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_author</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><span style="font-size: x-small;">nota: También pueden pasar los datos en un array.</span></p>
<p>Otra función que nos puede servir es:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;">echo</span> xprofile_get_field_data<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'deporte favorito'</span><span style="color: #339933;">,</span><span style="color: #000088;">$current_user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.masquewordpress.com/como-mostrar-los-campos-de-perfil-de-buddypress-en-tu-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

