Is there any point to using wp_unique_post_slug?

As the commenters have noticed wp_unique_post_slug is called from wp_insert_post to ensure there are no double slugs. It is also called from two other functions, which explains why it is a separate function and not incorporated in wp_insert_post. A little used feature is the possibility to apply filters present in wp_unique_post_slug. There are two of … Read more

Post Format Status [closed]

Post formats is an optional value added to WordPress posts which allows theme developers to define visual representation of a post. Theme developers can create themes with support for post formats. A number of post formats are available, however it is not possible for themes or plugins to introduce custom post formats. It is not … Read more

How to get only post=’product’

If I understand you, what you are doing is wildly complicated. All you should need is a simple pre_get_posts filter: add_filter( ‘pre_get_posts’, ‘modified_pre_get_posts’ ); function modified_pre_get_posts( $query ) { if ( $query->is_search() ) { $query->set( ‘post_type’, ‘product’ ); } return $query; } Plus your filter that adds DISTINCT. post_type is a query parameter rolled into … Read more

WordPress limit post that subscriber can create

This solution uses the publish post hook. What’s happening here is that when a post is published, it runs the custom post_published_limit function we create below. The $max_posts is set statically here, you can expand it to pull the value from elsewhere, but that’s beyond the scope of the question being asked. However there is … Read more

Title displaying multiple times

The function wp_title() is supposed to be used to generate the text for the title tag: <head> <title><?php wp_title();?></title> … </head> but to display the current post title within the loop, you should instead use the the_title() function.

WordPress Post Content Display

use this code to show only content of post $args = array( ‘order’ => ‘ASC’ ); query_posts( $args ); while ( have_posts() ) : the_post(); // get only post of content not work plug-in short code $post_7 = get_post(get_the_ID()); echo $title = $post_7->post_content; endwhile; // Reset Query wp_reset_query();

How add class the_content();?

You don’t. You’ll need to put an element around it: <?php if ( $content_source == ‘excerpt’ ) { ?> <div class=”excerpt”> <?php the_excerpt(); ?> </div> <?php } else { ?> <div class=”content”> <?php the_content(); ?> </div> <?php } ?>