Tag Archives: Wordpress

Using galleries (or other accesses to ORDER BY FIELD() ) in WordPress over PostgreSQL using PG4WP driver

Issue Galleries in WordPress 3.6 does not show in a setup over a PostgreSQL database using PG4WP driver. Diagnostic The gallery functionality makes use of ORDER BY FIELD() MySQL command that is not handled by the PG4WP 1.3.1 driver. Solution … Continue reading

Posted in IT stuff | Tagged , , | Leave a comment

Add missing wpsql_errno in PG4WP plugin

Today I tested updating our website based on WordPress using a Postgresql database through the PG4WP driver. Unfortunately, it seems that the author doesn’t update it anymore since 2012. Version 3.9.1 of WordPress makes new functions calls to the database … Continue reading

Posted in IT stuff | Tagged , , | 6 Comments

Changing the duration of login in WordPress

WordPress remembers your login during some time. If you want to change it to one year, add this code to your functions.php add_filter( ‘auth_cookie_expiration’, ‘keep_me_logged_in_for_1_year’ ); function keep_me_logged_in_for_1_year( $expirein ) { return 31556926; // 1 year in seconds } Source: … Continue reading

Posted in IT stuff | Tagged | Leave a comment

Show a custom template for a single post in a particular category

Add this filter to your functions.php and name your template file to match the category slug: single-[cat slug].php. If you’re using a child theme, replace TEMPLATEPATH with STYLESHEETPATH : //Gets post cat slug and looks for single-[cat slug].php and applies … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment

Put WordPress list in ascending order

Open your theme’s page and put this code: <!–?php query_posts($query_string. “&order=ASC”); ?> before the <!–?php if ( have_posts() ) : ?> <!–?php while ( have_posts() ) : the_post(); ?> Or change another query_posts that you find in your code to … Continue reading

Posted in IT stuff | Tagged | Leave a comment