Damian Gostomski
Forum Replies Created
-
Forum: Everything else WordPress
In reply to: Preview button does not workWhen you attempt to preview a post and it shows the first page, does it actually redirect you to the first page (the URL changes), or does the URL still contain
?p=XXX&preview=trueCan you preview other articles (either already published, or ones that aren’t scheduled for the future?
Forum: Themes and Templates
In reply to: Problem with templateAndrew – If you use %d as a placeholder, then it will expect an integer, not a string.
Something like this should work (not tested):
$request = $wpdb->prepare("SELECT ID, post_title, post_date, post_excerpt,LEFT(post_content, %d) AS short_post_content FROM $wpdb->posts WHERE post_status = 'publish' ", $sqllimit);Let me know if that resolves the issue. It’s also worth reading the Codex on the WPDB class to get a better understanding of it: http://codex.wordpress.org/Class_Reference/wpdb
Forum: Themes and Templates
In reply to: Problem with templateThe prepare function is used to securely substitute placeholders in a SQL query with the corresponding values.
You can read on how to use it properly and why this error started occurring in WordPress 3.5 here: http://make.wordpress.org/core/2012/12/12/php-warning-missing-argument-2-for-wpdb-prepare/
Assuming $sqllimit is an integer, you should replace it with %d and pass the variable in as the second parameter to the prepare function.