Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

Wordpress

How to add a checkbox element to attachments editor with example

August 4, 2022August 3, 2022 by Magenaut

The code below adds a custom input field to the attachments editor. How can I convert the text input to a checkbox and get/set the value of the checkbox on load and save?

Categories Q&A, Wordpress Tags custom-field, theme-development Leave a comment

Help to condense/optimize some working code

August 4, 2022August 3, 2022 by Magenaut

WordPress by default shows ALL posts to users who are Authors. I wanted Authors to only be able to see their own posts so I came up with the following code which works well.

Categories Q&A, Wordpress Tags author, query-posts, user-roles Leave a comment

Related posts display randomly by tag

August 4, 2022August 3, 2022 by Magenaut

I would like to ask that what code should i add in order to make my related posts by tag to display randomly? I got this code from somewhere else.

Categories Q&A, Wordpress Tags posts Leave a comment

simple solution for restricting access to (some) uploads/downloads

August 4, 2022August 3, 2022 by Magenaut

and of course it is a must that the .htaccess file is in place

Categories Q&A, Wordpress Tags attachments, content-restriction, private, security, uploads Leave a comment

Setting a post’s featured image from an embedded YouTube video

August 4, 2022August 3, 2022 by Magenaut

If I create a post that has an embedded YouTube video in it (so all I do is paste the YouTube URL into the post and let WordPress automatically embed it for me), is there a way to have the thumbnail image of the video set as the post’s featured image?

Categories Q&A, Wordpress Tags embed, post-thumbnails, videos, youtube Leave a comment

How to use the_posts_navigation for wp_query and get_posts?

August 4, 2022August 3, 2022 by Magenaut

WordPress have the_posts_navigation function since 4.1.0. But I don’t know how to use with wp_query or get_posts. the following code is in a template file of page.
wp_query method:

Categories Q&A, Wordpress Tags get-posts, navigation, wp-query Leave a comment

Is There A Hook To Process The Content Of The Text Widget?

August 4, 2022August 3, 2022 by Magenaut

Is there any filter which can be used in a plugin to process the content of the text widget before it is rendered?

Categories Q&A, Wordpress Tags customization, plugin-development, widget-text, widgets Leave a comment

template_include (overriding default plugin templates via current theme)

August 4, 2022August 3, 2022 by Magenaut

This is an extension of this question/answer. A comment on that question references that template_include is preferred to template_redirect when loading templates from a plug-in.

Categories Q&A, Wordpress Tags plugin-development, template-redirect Leave a comment

Override default WordPress core translation

August 4, 2022August 3, 2022 by Magenaut

WordPress is set to Dutch language. When I use get_the_archive_title() my theme correctly outputs “Categorie: Category-name” on a category archive page. However I’d like that to read “Sectie: Category-name”.

Categories Q&A, Wordpress Tags language, translation Leave a comment

How to make search include data from wp_postmeta?

August 4, 2022August 3, 2022 by Magenaut

I have a site using Advanced Custom Fields to create and store various bits of relevant info. These need to be included in the main general search, which by default only searches the title and main content.

Categories Q&A, Wordpress Tags post-meta, regex, search Leave a comment
Older posts
Newer posts
← Previous Page1 … Page213 Page214 Page215 … Page430 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress