Aug 31, 2012

Numbered Navigation without plugin

Filled under:

Numbered Navigation without plugin
I think half the planet that uses WordPress plugin uses PageNavi to offer something better than the typical " Previous Page - Next Page "and the truth is that is fine.

Little does he know that half the planet is that it can provide the same functionality without having to use the plugin ...


And half the planet is what WordPress just does not know is that since version 2.1 of WordPress is a function for exactly the same functionality to offer tickets numbered navigation .

Numbered Navigation without plugin

Best of all, it consumes far fewer resources than the PageNavi plugin , and use it only have to do two steps:

1. Create the function

Add this code to your plugin function or file functions.php of your current theme:


//Paginación de entradas
function wp_corenavi() {
  global $wp_query, $wp_rewrite;
  $pages = '';
  $max = $wp_query->max_num_pages;
  if (!$current = get_query_var('paged')) $current = 1;
  $a['base'] = str_replace(999999999, '%#%', get_pagenum_link(999999999));
  $a['total'] = $max;
  $a['current'] = $current;

  $total = 1; //1 - muestra el texto "Página N de N", 0 - para no mostrar nada
  $a['mid_size'] = 5; //cuantos enlaces a mostrar a izquierda y derecha del actual
  $a['end_size'] = 1; //cuantos enlaces mostrar al comienzo y al fin
  $a['prev_text'] = '« Anterior'; //texto para el enlace "Página siguiente"
  $a['next_text'] = 'Siguiente »'; //texto para el enlace "Página anterior"

  if ($max > 1) echo '<div class="navigation">';
  if ($total == 1 && $max > 1) $pages = '<span class="pages">Página ' . $current . ' de ' . $max . '</span>'."\r\n";
  echo $pages . paginate_links($a);
  if ($max > 1) echo '</div>';
}


2. Add the function to your theme

Once you save the changes you just add the following code where you want to display the page of entries, usually in the first line of the file footer.php your active theme:

<?php if (function_exists('wp_corenavi')) wp_corenavi(); ?>

Guards new changes and you're done. The resulting HTML function might look like:


<div class="navigation">
  <span class="pages">Página 7 de 27</span>
  <a class='prev page-numbers' href='http://tusitio.es/page/6/'>&laquo; Anterior</a>
  <a class='page-numbers' href='http://tusitio.es/page/1/'>1</a>
  <span class='page-numbers dots'>...</span>
  <a class='page-numbers' href='http://tusitio.es/page/4/'>4</a>
  <a class='page-numbers' href='http://tusitio.es/page/5/'>5</a>
  <a class='page-numbers' href='http://tusitio.es/page/6/'>6</a>
  <span class='page-numbers current'>7</span>
  <a class='page-numbers' href='http://tusitio.es/page/8/'>8</a>
  <a class='page-numbers' href='http://tusitio.es/page/9/'>9</a>
  <a class='page-numbers' href='http://tusitio.es/page/10/'>10</a>
  <span class='page-numbers dots'>...</span>
  <a class='page-numbers' href='http://tusitio.es/page/27/'>27</a>
  <a class='next page-numbers' href='http://tusitio.es/page/8/'>Siguiente &raquo;</a>
</div>


All the dots rebonito dividers for your WordPress offers a useful and visually interesting navigation .

Posted By Unknown3:59 PM

Aug 8, 2012

Learning to use the css-property clip

Filled under:

Learning to use the css-property clip
You've probably heard about the new css3 property called Clip . Today we'll talk a bit about its syntax and will learn to create interesting effects with it.




Syntax
example {
    position: absolute;
    clip: rect(110px, 160px, 170px, 60px);
}
The first thing you should know about Clip - is the fact that this property can only be added to the element that has absolute positioning ( position: absolute or position: fixed ).

The value can be defined as a form or set automatically. To auto has no restrictions and is the default for all elements.

To determine the form (currently allowed only rectangles) should set rect (), passing the values ​​that define the shape. Values ​​can be positive or negative.

The value of rect ()
example {
    position: absolute;
    clip: rect(110px, 160px, 170px, 60px);
}
The values ​​passed to the rectangle () seem at first sight a little bit confused, but soon you realize that there is nothing complicated here. Values ​​determine the offset from the top and left of the item.

In other words, in the example above, the first value is attached to an imaginary line running horizontally long 110px from the top (first value) and the second horizontal line 170px from the top - this is the third value. The second meaning - to an imaginary vertical line up 160px left, and the last value - for other imaginary vertical line up 60px to the left.

If this confuses you, maybe this picture will help:

Learning to use the css-property clip

This skinshot uses guides to show you where to put the corresponding values ​​of imaginary intersecting lines. Bright field images are part of the image, which would be vidny.Ostalnye will be hidden. Thus, the "trimmed" the area is determined by the intersecting lines of the area that remains.

It should also be noted that IE6 and IE7 support this property, but instead of commas separating the values, this requires a browser space.

Create an animated gallery

Check out this gallery of animation, to better understand how the style parameter clip.
See the demo
Author:  impressivewebs

Posted By Unknown1:32 PM

Aug 6, 2012

How to add featured images by category

Filled under:

How to add featured images by category
The featured images are a very interesting feature of WordPress since version 2.9, but we have not always been fine, or as many entries have undefined featured picture, or just do not want to put a different one each time.


For all these occasions the possibility of defining images highlighted " by default ", without interaction from the user, and that the item we use always show something.

And a special case, is whether we want to define a default featured picture depending on the category of entry. That, incidentally, is a really interesting and useful possibility that the article did not cover how to add thumbnails by default on all inputs .

To achieve this we have the perfect assistant ...

Default thumbnail Plus plugin is a very completito while simple, with the difference that you can set default images for each category, which is a "plus" important.

It is a widely used plugin portals especially in technology, to identify issues on the cover, depending on the category, its main virtue.
How to add featured images by category
And if you know someone else you tell us and add it.

Posted By Unknown2:01 PM

Modules without JetPack

Filled under:

Modules without JetPack

JetPack , the megaplugin Automattic has many virtues, but a great disadvantage, that some do not like anything, is the dependence on WordPress.com , you have to open an account if or to use any plugin module.

This disadvantage for some, but not for others. I mean, anyone who just arrived to find WordPress a great ally in JetPack , which after passing through register on WordPress.com, you make life easier by offering a good amount of functionality by installing a single plugin.

For others, the fact of requiring registration, or for some services to be connected with WordPress.com to run, is just the opposite.

Well, if you like any of the modules JetPack but do not want this dependency there are options ...


One option is to use the Jetpack modules that can be used independently, without installing the full plugin for this WPsites uploaded them for download alone, are these:

Carousel JetPack
Contact forms JetPack
Jetpack social buttons to share
Any other option is, for example, you can use the Jetpack Carousel without a plugin that does the same function but without the megaplugin, or install on your own ShareDaddy , which is actually the plugin " father "of the" Share " of Jetpack.

And so far already, if you know of any replacement plugin modules JetPack you tell us in comments.

Posted By Unknown1:50 PM

Locking down WordPress - free book on WordPress Security

Filled under:

Locking down WordPress - free book on WordPress Security

In Code Poet has created a book in electronic format , downloadable in PDF, ePub and Kindle, with 39 pages of tips and tricks on how to ensure WordPress .


From the hand of experts like Rachel Baker, Brad Williams and John Ford, each chapter is showing his tricks and good advice to have a secure WordPress .

At the end of the book also is a good amount of resources, with links to information about safety and even recommended plugins.

I downloaded this morning and the truth is it's a good collection, really interesting, as the advice we've seen here on many occasions.

If you want, here you have the issue in PDF, the rest on the original site ...

 Locking down WordPress - WordPress v.3.0 Security Paper (2.47 MB)

Posted By Unknown1:40 PM

Aug 2, 2012

Setting a minimum entry

Filled under:

Setting a minimum entry

Remember that almost 4 years ago we saw a code that cause the comments are longer ?, then watch where we now have an easier way even if it is to control the content posted on our website have a minimum quantity for quality is still no plugin that detects .

I mean, Comment Minimum Length , a very simple plugin but will replace that code shared anything for 4 years old! (sorry for myself heavy with this is that I am surprised that we were talking about this already in 2008)

Its operation is simple, you install it, activate it and go to the plugin settings page to set 2 parameters : minimum length in characters of the comments, and text to be displayed to visitors of few words. Save the changes and go.
Setting a minimum entry


The next visitor to leave a comment with fewer characters than you have defined will see a warning message to be encouraged to discuss something with more substance . The only ones who are saved from this restriction, which we did not get to the code are the editor and administrator, the rest to make or receive a warning.

The question is, is it necessary or interesting thing? , well look, the truth is yes. I've got a mouth to say that the comments are also content, and they need to moderate them for that, being aware of that affect the positioning of our website, its content is related to the subject treated in the content of the input, and with the highest quality possible. If you also control a minimum of "quantity" avoid comments that contribute nothing, and sometimes even penalizing us, such as " Thanks "or" You're a crack , "or the typical" I found your blog and I love to visit the mine . "

What do you think?

Posted By Unknown12:53 PM

WPNuggets - plug-site reviews

Filled under:

WPNuggets - plug-site reviews


There's a new kid in town, WPNuggets . This new site dedicated to WordPress specializes in doing WordPress plugin reviews . 

It is fairly new, so today there are only 6 reviews, but any of them give good faith in the quality of work being done and is very good option - especially when it grows in content - to take a look before deciding to install a plugin or another . 

The concept is simple, without fancy stuff of any kind, based on entries in which they will explain step by step the features of the plugin and finally, an assessment is made ​​(no score) of the same , which I believe is the main shortcoming of this site, because I expect to score in the future, to decide it based on the choice between a plugin and another.

In any case it is always good news any new site that will teach us more about WordPress and its entire ecosystem, and this is it.

Posted By Unknown12:45 PM

Sample content for testing WordPress themes

Filled under:

Sample content for testing WordPress themes

If you are launching a site and want to try as you will see a new theme, or as will be CSS changes you are doing, or just present a sketch of a site for a client, often the most tedious is to start creating content shows that "fill" the site and can appreciate what it can offer.

Well, in case you did not know, is an XML file in the repository you can use WordPress for this utility . Find it at: http://svn.automattic.com/wpcom-themes/demo/demo-data.09-27-2010.xml 

The downloads on your computer, go to sample site and in ' Tools -> Import 'choose' WordPress '. If the importer is not installed install it (remember that now is a plugin disabled by default) and you can import the xml file you just downloaded.

What you get is a content site where you can plump will show as ordered and unordered lists, the h1, h2, h3, bold, italics, images on one side and other stuff. Very useful is not it?

Posted By Unknown12:39 PM

WordPress 3.5 on December 5

Filled under:

WordPress 3.5 on December 5


We are still beginning to enjoy WordPress 3.4 and we almost have a date for the next version: WordPress 3.5 , which developmental conference on Wednesday was estimated for December 5 as the first proposed date.

We are still beginning to enjoy WordPress 3.4 and we almost have a date for the next version: WordPress 3.5 , which developmental conference on Wednesday was estimated for December 5 as the first proposed date.

Among the new features of WordPress 3.5 that are already targeting the following: 

  • New Default Theme Twenty Twelve , which as I said the other day was postponed to WordPress 3.5 
  • Important changes and improvements in the interface 
  • Improvements in the "customizer" of issues relating to the menus and header image management and fund 
  • It will remove the link manager, which makes perfect sense because of its limited use, only with regard to the widget links or any page template. I do not know is that is replaced or how. 
  • Changing the image loading mode. 
  • Change in the gallery, I hope finally incorporate the inclusion of several galleries in the same input. 

Posted By Unknown12:28 PM