Contact Form 7 and Gmail… How?

Recently installed Contact Form 7 and found myself in front of difficulty. The solution took me awhile. To set Contact Form 7 send mail to Gmail you need WP-Mail-SMTP plugin.

Configuring the plugin also took some time, but I finally got it.

WP-Mail-SMTP configuration to work with Gmail smtp server
WP-Mail-SMTP configuration to work with Gmail smtp server

I left some fields empty which config dinamically wordpress to send to default email. In our case this is the email set in Contact Form 7 form.

Make the navigation of a single post page to work

In the wordpress codex, the format of previous post link is:
<?php previous_post_link($format, $link, $in_same_cat = false, $excluded_categories = ''); ?>
Respectively for the next post will be:
<?php next_post_link($format, $link, $in_same_cat = false, $excluded_categories = ''); ?>
Example:
<?php previous_post_link('<strong>%link</strong>', '<< Previous', TRUE, '5'); ?>
<?php next_post_link('<strong>%link</strong>', 'Next >>', TRUE, '5'); ?>

Post limit per page for different pages

Put this code in your function.php file in your template foldier.

function limit_posts_per_page() {
if ( is_category(5) )
return 1;
else
return 5; // default: 5 posts per page
}

add_filter(‘pre_option_posts_per_page’, ‘limit_posts_per_page’);

function limit_posts_per_archive_page() {
if ( is_category(5) )
set_query_var(‘posts_per_archive_page’, 1); // or use variable key: posts_per_page
else
set_query_var(‘posts_per_archive_page’, 5); // or use variable key: posts_per_page
}

add_filter(‘pre_get_posts’, ‘limit_posts_per_archive_page’);

I have one category (category id=5) that I want to have a limit 1 post per page and every other categories to have 5 posts per page.

That is.