Post count doesn’t match number of posts shown in list in admin
Post count doesn’t match number of posts shown in list in admin
Post count doesn’t match number of posts shown in list in admin
Go back to the exact post page number
I am wondering what changes I should make in the php code above so that it sorts WP_Post object array order by date. WordPress/PHP does not sort the objects, that’s not how this works. Additionally, the sort argument does not take the name of object fields. The two are not connected. The order of the … Read more
The PHP while command doesn’t work like that, it needs to start and end in the same code block. You can’t start it inside one if then end it somewhere else (although that would be nice!) What you can do is test have_posts before you start the while loop, and then keep which ever query … Read more
In your WP directory edit ( or create ) robots.txt User-agent: * Allow: /$ Disallow: / Then wait till search engine reindex your pages, or try to run it manually with google with Google Search Console
In your functions.php probably you want: echo ‘<a href=”‘ . get_permalink() .'”>’; There’s a function is_sticky( int $post_id ) which will let you see when a post is sticky. On the page you want to hide the sticky, inserting this line in the PHP at the top of the loop while tell it to skip … Read more
Now i got this code and i works. function get_events( ) { $recurrence_ids = get_post_custom_values( ‘_recurrence_id’ ); $recurrence_id = $recurrence_ids[0]; $the_query_args = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘event’, ‘meta_key’ => ‘_recurrence_id’, ‘meta_value’ => $recurrence_id ); $the_query = new WP_Query( $the_query_args ); if ( $the_query->have_posts() ) { $output=”<div class=”weitere-termine”>”; while ( $the_query->have_posts() ) { $the_query->the_post(); … Read more
The thing you’re talking about is called a custom meta box. They can be used to save post specific settings and data. You can create your own meta boxes with the help of add_meta_box() function. Here’s a quick example. This would go to your (child) theme’s functions.php file. Alternatively if you want to make the … Read more
Updated code for statuses as per @Fredrik’s answer as his is more accurate. To trigger this when publishing, you could change your first if to if ( $new_status === ‘inherit’ && $old_status === ‘new’ ) That way, your code should trigger only when you publish a post. EDIT: Some notes on your code. if ( … Read more
No blocks available when adding a new post