Skip to content

Magenaut

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

Q&A

Adding admin-ajax.php to the frontend. Good or bad idea?

August 4, 2022August 3, 2022 by Magenaut

I love admin-ajax.php. But I hate having to localize in order to point frontend scripts to it, and I wish there was an equivalent, easy-to-find file for themes. (It also just bothers me to see frontend requests go through “/wp-admin/”. No practical reason, just looks ugly IMO.)

Categories Q&A, Wordpress Tags ajax, themes Leave a comment

Rename files during upload using variables

August 4, 2022August 3, 2022 by Magenaut

I’d like to rename files during upload and set their names to the post slug the files are being attached to, plus some random characters (a simple incremental counter will de just fine) to make the filenames different.

Categories Q&A, Wordpress Tags slug, uploads Leave a comment

How to add a specific widget to only 1 page?

August 4, 2022August 3, 2022 by Magenaut

I would like to show a widget in only one page of my site, as i can see it is not possible right?

Categories Q&A, Wordpress Tags pages, screen-layout, widgets Leave a comment

Query all posts where a meta key does not exist

August 4, 2022August 3, 2022 by Magenaut

I am trying to get a query to retrieve all the posts where a specific meta_key does not exist and then create it.

Categories Q&A, Wordpress Tags custom-post-types, post-meta, wp-query Leave a comment

Add ‘has_children’ class to parent li when modifying Walker_Nav_Menu

August 4, 2022August 3, 2022 by Magenaut

I’m writing a customised walker class for wp_nav_menu and want to be able to specify if an li contains a submenu. So I want my markup to be:

Categories Q&A, Wordpress Tags menus Leave a comment

Rewriting post slug before post save

August 4, 2022August 3, 2022 by Magenaut

I need to retrieve an ACF field within the post, and change the slug(permalink) of the post before saving it to database. What is the approach to achieve that? I need the slug to be changed every create/edit post operations.

Categories Q&A, Wordpress Tags posts Leave a comment

Paged posts – how to use numbers and next/previous links?

August 4, 2022August 3, 2022 by Magenaut

I want wp_link_pages (mutli-page posts) to display the page numbers, the word “previous” before those numbers, and a “next” after those numbers. It would look like this:

Categories Q&A, Wordpress Tags paginate-links, pagination, wp-link-pages Leave a comment

Cookies in multisite where network sites have their own domain name

August 4, 2022August 3, 2022 by Magenaut

I decided to integrate several stand alone WordPress websites into a single multisite installation.

Categories Q&A, Wordpress Tags multisite Leave a comment

Ignoring initial articles (like ‘a’, ‘an’ or ‘the’) when sorting queries?

August 4, 2022August 3, 2022 by Magenaut

I’m currently trying to output a list of music titles and would like to have the sorting ignore (but still display) the initial article of the title.

Categories Q&A, Wordpress Tags database, order, sort, wp-query Leave a comment

How to restrict access to uploaded files?

August 4, 2022August 3, 2022 by Magenaut

I have a restricted area on a website that can only be accessed by logged in users. For that I created a page template with a ‘current_user_can()’ condition.

Categories Q&A, Wordpress Tags attachments, uploads, user-access, users Leave a comment
Older posts
Newer posts
← Previous Page1 … Page2,343 Page2,344 Page2,345 … Page2,571 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