Ajax Load More Posts in Category Page

Your query parameters don’t contain any category arguments. You need to pass and set cat or category_name along with the post type, offset, and posts per page. You can get the current category’s ID via get_queried_object(): $queried_object = get_queried_object(); $cat_id = $queried_object->term_id; Output and retrieve the value somewhere in your category template, or better, when … Read more

Allow variable amount of comments before pagination

This have several components to it – what option itself holds and how value from it is stashed away and reused by various pieces of core code. I am not sure this is perfect, but my quick take would be: new Adjust_Comments_Per_Page( 10, ‘years’, ‘category’ ); class Adjust_Comments_Per_Page { private $amount; private $term; private $taxonomy; … Read more

How to mark articles as read?

For a truly full solution you need to have all the users to have an account (or create one when marking as read) and you associate in the DB the user with the posts that he read and then style each link appropriately. To implement this you can look for inspiration in plugins that add … Read more

Is it possible to bold certain words in a post title?

Yes, you can use HTML elements in post titles by default. If your output is escaped a plugin or theme might have touched that. Disable all plugins and switch to TwentyEleven. This will help you to identify the source. Note that markup is stripped in some places where it is not allowed: title attributes and … Read more

Is it possible to Schedule Attachments in WordPress?

My idea is that you can setup a post date for the attachments. This can be done using attachment_fields_to_edit to show the UI (is possible use the touch_time internal function). After that, you can filter all the attachments query to show only the attachments with a past or current date. So add_action(‘load-post.php’, ‘setup_attachment_fields’); function setup_attachment_fields() … Read more

WP_Query: Why is sticky post not first item in loop?

If you look ate the source code where stickies are included, we find the following condition before WP_Query carries on to include sticky posts if ( $this->is_home && $page <= 1 && is_array($sticky_posts) && !empty($sticky_posts) && !$q[‘ignore_sticky_posts’] ) { The big game player is the is_home condition. Conditionals inside WP_Query is set according to the … Read more

WordPress Queue like Tumblr?

The Time Release plugin comes close, but has a fixed update period. The functionality is there, though, and I’d guess the portion of code that does the checking/updating could be hacked to use whatever (still-fixed) frequency you want without too much trouble. EDIT 2.16.12 Found a couple others that come much closer to Tumblr’s behavior … Read more

The hook for the AJAX Add to Cart button?

Digging through the code, it’s pretty straight-forward to find. First, look at the template used for product archives – /templates/archive-product.php. Among other things, it sets up the regular queries and begins building the markup of the page. But when it actually starts looping through each product, it delegates the work to /templates/loop-shop.php. This template is … Read more

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