WordPress Development Weekly Newsletter
WordPress Development Weekly Newsletter

Top new questions this week:

Should I write a PHP function in home.php?

I am trying to learn WP Theme development. And as I have understod all "wp core" functions should be placed inside functions.php. But what about custom functions? Lets say I would need a simple ...

<php> <functions>  
asked by Johan Gudmundsson 5 votes
answered by leymannx 8 votes

Loading posts associated only to the logged in user on recent posts page

Dear Wordpress Captains, I've stumbled upon a problem and I am seeking for assistance. What I'm trying to create is a customer portal where the logged in user will only see the posts that are ...

<plugins> <users> <content-restriction>  
asked by Alex Broere 4 votes
answered by Pieter Goosen 5 votes

Hide password protected posts in admin

I'm building a site for a client and we're using WordPress' native password protect functionality. Is there a filter or some kind of action to filter posts retrieved in the administration panel? If I ...

<posts> <password>  
asked by Dueify 4 votes
answered by birgire 3 votes

Data sanitization escaping HTML apostrophes

I have a plugin that I am developing that takes user input from a form. After the form is submitted, the input is then assembled to create an 'About Us' type paragraph of HTML. This is then used to ...

asked by David Webb 3 votes
answered by shanebp 2 votes

Pre-filling custom fields on New Post

I'd like to have a number of custom fields automatically added and pre-filled (with a static default value) when a user opens the 'Add New Post' page in the admin panel to create a new post. The point ...

asked by Alpha_Hydrae 3 votes
answered by birgire 4 votes

WordPress category & taxonomy loop with pagination

I have two taxonomies belonging to the same post type (posts). Adventure - belonging to the category taxonomy Adventure - belonging to the holiday-type taxonomy I want to run two queries: $args = ...

<loop> <pagination> <taxonomy>  
asked by user1682743 3 votes
answered by terminator 0 votes

wp_head() gives me some weird CSS

I was trying to enqueue my stylesheets but it didn't work. Turns out I had forgotten to include wp_head() inside my <head> tag. So I did and then my stylesheets where loading fine. The problem ...

<css> <wp-head>  
asked by Johan Gudmundsson 3 votes
answered by Ignat B. 6 votes

Greatest hits from previous weeks:

How to create a custom search for custom post type?

I have a search field for the blog posts, but I need an other for a custom post type. How can I create this custom search form with a different search result layout?

<custom-post-types> <customization> <search>  
asked by robert 11 votes
answered by Ronald 14 votes

Restricting users to view only media library items they have uploaded?

I want users to be able to upload photos using add_cap('upload_files') but in their profile page, the Media Library shows every image that's been uploaded. How can I filter that so that they can only ...

<images> <media>  
asked by TerryMatula 27 votes
answered by t31os 21 votes

Can you answer these?

How to add new embed handler not supported by oembed

I am looking to embed videos from websites that do not offer oembed support, but the reference offered on wp codex about wp_embed_register_handler() is just too broad for someone like me. I tried ...

<embed> <videos> <oembed>  
asked by musasi 2 votes

How can I remove the folder from a Multisite URL?

I necessarily have a multisite installation in a subfolder. For most of the Sites this is fine, but I would like to remove that folder entirely for another Site. Like so: ...

<multisite> <site-url>  
asked by mmcglynn 1 vote

link to non-category page routed to category template

Working on a theme I was surprised when a link to an about page (about is not a category) is routed to the category template. Why is this so? The template file for the about page is default. Then I ...

asked by suspectus 1 vote
Subscribe to more Stack Exchange newsletters

Unsubscribe from this newsletter or change your email preferences by visiting your subscriptions page on stackexchange.com.

Questions? Comments? Let us know on our feedback site. If you no longer want to receive mail from Stack Exchange, unsubscribe from all stackexchange.com emails.

Stack Exchange, Inc. 110 William St, 28th Floor, NY NY 10038 <3