All posts by Tomislav Vlahović

Ubuntu & Debian PostgreSQL setup

#File Locations:
Configuration files: /etc/postgresql/[version]/[cluster]/
Binaries: /usr/lib/postgresql/[version]
Data files: /var/lib/postgresql/[version]/[cluster]
# Instaliraj server i dodatni softvare
apt-get install postgresql
apt-get install postgresql-contrib
# Generiraj hr_HR locale
sudo locale-gen hr_HR.UTF-8
# Postavi da se na bazu može spojiti i lokalno pomoću šifre
vi /etc/postgresql/9.1/main/pg_hba.conf
local   all             all                                     password
# Za development, da se može spojiti na server preko TCP/IP protokola
host   all   all  0.0.0.0/0   password
i u postgresql.conf: listen_address = '*'
# Kreiraj superuser korisnika, pita za šifru
createuser -P -s -e myuser
# Kreiraj bazu
createdb -O myuser -E UTF8 -T template0 --locale=hr_HR.utf8 mydb
# Napravi restart PostgreSQL servisa
sudo /etc/init.d/postgresql restart

No plugin pagination

global $wp_query;
$total = $wp_query->max_num_pages;
// only bother with the rest if we have more than 1 page!
if ( $total > 1 )  {
     // get the current page
     if ( !$current_page = get_query_var('paged') )
          $current_page = 1;
     // structure of "format" depends on whether we're using pretty permalinks
     $format = empty( get_option('permalink_structure') ) ? '&page=%#%' : 'page/%#%/';
     echo paginate_links(array(
          'base' => get_pagenum_link(1) . '%_%',
          'format' => $format,
          'current' => $current_page,
          'total' => $total,
          'mid_size' => 4,
          'type' => 'list'
     ));
}

Izvor: http://wordpressexperts.net/how-to-add-pagination-in-wordpress-without-plugins-its-easy/