Can I load posts via Ajax?

Absolutely! There are a number of themes on the market that do load posts via AJAX. Take a look at any of them to get an idea of how they work. A particularly good example is K2 – K2 loads entire pages of posts via AJAX if you click on the previous posts link. To … Read more

How to disable drafts?

If by draft, you mean “autosave”, you can consider using this plugin: http://wordpress.org/extend/plugins/wp-feature-disable/ If you want to disable revisions, instead…try this: define(‘WP_POST_REVISIONS’, ‘false’); You can put that in your /wp-config.php file and it should immediately take effect. Any previously saved revisions in your database will need to be purged. You can do it by running … Read more

Post ids are incrementing by an unknown number?

Every revision or auto-draft that’s saved is added to the database and given its own auto-incremented ID. So in theory, you could turn off post revisions ( adding the line define(‘WP_POST_REVISIONS’, false); to your wp-config.php), and be very careful to write your posts in exactly the order you want your IDs to follow, and you’d … Read more

Exclude ALL posts from sub categories

Don’t change your template, and please do not use query_posts. Add this to your function.php: add_action(‘pre_get_posts’, ‘filter_out_children’); function filter_out_children( $query ) { if ( is_main_query() && is_category() && ! is_admin() ) { $qo = $query->get_queried_object(); $tax_query = array( ‘taxonomy’ => ‘category’, ‘field’ => ‘id’, ‘terms’ => $qo->term_id, ‘include_children’ => false ); $query->set( ‘tax_query’, array($tax_query) ); … Read more

Edit a post from frontend. post_tags get saved, but not separated

Ok, found a solution by myself. In the past i saved post_tags with wp_set_post_terms($pid, array($_POST[‘post_tags’]),’post_tag’,false); Now i save the post_tags with wp_set_post_tags($pid, $_POST[‘post_tags’]); and it works. This way is the same method, i use to publish a new post from the frontend. Changed only this, nothing else.

Get post only from ‘standard’ post format

Do, <?php if( false == get_post_format() ){ ?> <a href=”https://wordpress.stackexchange.com/questions/103119/<?php the_permalink(); ?>” rel=”bookmark”><?php the_title(); ?></a> <?php } ?> The standard post format isn’t actually a post format, so if you conditionally check whether a post contains a post format (other than the default standard), it will return false, because it’s set to… standard.

When a user creates a post (pending), send a confirmation link that allows them to publish

You need a function that hook into post status transitions and send and email containing a link with some verification variables and a function that takes that variables, check them and if all ok update posts status. Following code I think is self-explanatory, and comments give additional help: add_action(‘new_to_pending’, ‘send_approve_link’); add_action(‘draft_to_pending’, ‘send_approve_link’); add_action(‘auto-draft_to_pending’, ‘send_approve_link’); add_action(‘init’, … Read more

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