Use Loop or direct database query?

In general I try to avoid custom SQL queries as much as i can and use the native WordPress functions but in some cases its much better/faster to use custom queries. if the case is just get a list of posts the you can use the WP_Query or get_posts which will work almost as fast … Read more

Loop output for custom plugin [solution found]

The Solution to my problem is to simply let my plugins output run through the do_shortcode()-Function of WordPress as pointed out by this article: Using Shortcodes Everywhere I updated my plugin so it uses shortcodes, too, so now my output looks like this: // Add this upon plugin initialization add_shortcode( ‘dosomethingawesome’, array( &$this, ‘output_callback’) ); … Read more

The Loop for my theme with static front page is not working

Just before the snippet i posted i was doing something like $posts = array();, it seems that wordpress keeps the collection of the posts to be used on the loop in a variable of the same name, so i was meesing with the data, just changed $posts for $items and now works fine.

The loop: more posts than I want to fit on one page

You’re looking for one of two things: either paginate_links(), or the combination of next_posts_link() and previous_posts_link(). Both of these functions allow for “pagination”, or the ability to place links to more content than you’re displaying in a screenful. Google does this on the bottom of most pages, for example. Of the two methods I mentioned … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)