New answers tagged posts
0
votes
Change the slug of post type using custom code
There is a function called wp_unique_post_slug which is called whenever you save a post. This function contains a filter of the same name that you can use to modify the slug, depending on, for ...
0
votes
Adding content to the top of post's based on their category
You can use the the_content filter for this:
add_filter( 'the_content', 'wpse420024_filter_content' );
/**
* Conditionally adds content above the post content.
*
* @param string $content The post ...
0
votes
set role specific screen options in post summary page
You would use the default_hidden_columns filter. Here's an example of what I did to hide a column in the Media Library:
add_filter( 'default_hidden_columns', function( array $hidden, WP_Screen $screen ...
0
votes
How can I specify a category post on my home page
Quick example we are using in HoverCraft inside index.php that fails gracefully, which will affect either your homepage and/or "Posts page" depending on your settings:
<?php
...
0
votes
Show posts assigned to multiple categories in current category page
That's because that's what you're asking for:
'category__in' => array($category),
It's only going to show posts in that category.
You shouldn't be using get_posts() or WP_Query() in category.php. ...
1
vote
Accepted
Show category name in category.php when posts assigned to multiple categories
For the heading on a category archive use either:
the_archive_title();
Or:
single_term_title();
The first one can be used on the template for any archive, while the second should only be used on ...
0
votes
Creating posts with links from a txt file
I think you get errors because you create duplicated posts named as "test". Postcreator function's 1rst argument should be dynamic, hot hardcoded. When you activate the plugin the loop is ...
0
votes
Hide page title on dedicated posts page
With the limited information here, it's hard to point you in the right direction...so I'll try my best.
Assumptions:
You are using the WordPress theme twentytwentythree or newer
The best way I've ...
Top 50 recent answers are included
Related Tags
posts × 5982categories × 576
custom-post-types × 575
wp-query × 463
customization × 463
php × 405
pages × 398
loop × 387
plugins × 323
functions × 241
query-posts × 195
permalinks × 192
images × 189
query × 177
custom-field × 160
post-meta × 149
filters × 134
pagination × 133
tags × 132
templates × 127
author × 120
get-posts × 117
database × 116
theme-development × 115
comments × 110