All Questions

Filter by
Sorted by
Tagged with
3 votes
2 answers
3k views

"Could not open input file" error even when WP-CLI is in the path

I'm developing Wordpress locally with XAMPP, and currently trying to install the WP-CLI tools as described here using Cygwin. I renamed wp-cli.phar to wp, made it executable and moved it to the ...
3 votes
1 answer
1k views

Give editors access to particular plugin - turn "admin.php" into "edit.php"

I'm using the Business Opening Hours plugin. I made it appear in the sidebar using the Client Dash plugin, but when the Editor clicks it, they cannot access it, only the Admins, how can I change that? ...
0 votes
1 answer
920 views

Scrape external webpage for first image and add it to new post

I'm looking for a way to scrape an external page for its first/best/largest image and insert a copy of that image as the featured image of a new post on my Wordpress site. The way that I was hoping ...
1 vote
0 answers
9 views

update_callback is not working in register_rest_field

I am registering a new field in my custom post type using register_rest_field. But I am unable to add/update the field using the rest API of post add/edit. However, the get_callback function is ...
4 votes
6 answers
25k views

How to hide an item from a menu to logged out users (without a plugin)

I want to hide an item from a menu if a user is logged out. I am currently using the below code that achieves this using two separate menus, but to save duplication, I would like to only have to ...
0 votes
1 answer
10 views

Use a custom block in another block

Let's assume that I have a music player block and it's working fine. I now want to add another block for playlists and I want to use this single player block in this block. Is it possible to import ...
0 votes
0 answers
36 views

Why will comments not remain open on custom post types?

I have a WP install which makes use of default posts and of one custom post type (reviews). Discussion settings allow comments on both these post types. The comment form is present when viewing posts ...
0 votes
0 answers
5 views

Trying to create a page as a menu item in the admin while keeping the admen panel visible

I'll try my best to explain this in a way that makes sense. I'm customizing the WP admin dashboard and trying to add more elements to it by adding new menu items in the admin panel. Now when I create ...
0 votes
2 answers
2k views

How to submit form data in the same page in WordPress without reloading the page?

I have a custom PHP template - form. I'm trying to send this form in the same page using AJAX without reloading the page. Hide the form after submission and display the thank you message. This form is ...
0 votes
2 answers
492 views

What is my error trying to create a new table in the database?

I tried creating the tables in different ways and I always get the same error: "Error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the ...
1 vote
2 answers
4k views

get 404 when accessing wp-admin/plugin-install.php

While freshly installed, I cannot access the 'Add new plugins` page whatsoever. It just keep waiting & then redirect me to 404 page of the current theme. I'm not sure what went wrong as the ...
0 votes
1 answer
1k views

Removing add new pages form editor role

Hi I have set up multisite and I am the super admin. I want to remove the capabilities of "Editors" to add new pages. I made this change to my theme function, which removed what I want it too, ...
0 votes
1 answer
3k views

PHP is_embed error showing up

I can't seem to find what's causing the error to show up when I enabled the debug mode on my WordPress website that is installed locally. Notice: is_embed was called incorrectly. Conditional query ...
0 votes
0 answers
9 views

LinkControl - how to toggle opensInNewTab

When I click the "open in new tab" toggle, nothing happens in the UI. The onChange is triggered. How do I set the toggle to true? I am using the following: https://github.com/WordPress/...
1 vote
0 answers
10 views

Gutenberg theme development: how to add "headers" option under styles > colors > elements?

I'm not sure if this is even possible as I'm still learning about Gutenberg full site editing theme development. I've done my best to research this and read over the documentation before asking this ...
0 votes
0 answers
8 views

CPT: Enable Gutenberg, but disable editor field

I have a CPT which does not need an HTML/content/editor field. It seems I have to add at least "supports" => [ "editor" ] to the args of register_post_type(), but then it is ...
3 votes
1 answer
17 views

How to properly package a block plugin

I've created a little WordPress block, starting from the npx @wordpress/create-block template. All is well and good, but I need to fix the packaging process. The main plugin file includes a couple of ...
0 votes
1 answer
612 views

Passing parameter from the current URL to redirect to another url

I have a search results page and on the page, I would like to be able to filter by category. So when the user searches an item, it gets passed to the results page in the url like: website.com/?s=...
0 votes
2 answers
581 views

Gutenberg blocks not full width

I am having an issue where an image block in Gutenberg editor is not the full with of the page even though I have selected "Full Width" in the back-end. Is there a way to fix this? Image for ...
0 votes
1 answer
9 views

Bulk Updating Post Date in 1 day Increments

I have 1700 Motivational Updates + Write ups imported to WordPress. The problem is they are all published on the same date. I'd ideally like for them to be published once per day. I researched a lot ...
0 votes
1 answer
6 views

Hide custom column in admin template screen (Elementor)

My plugin adds a custom column to admin posts and pages screens but it's also adding it to the Templates (Elementor) screen. I know users can hide this themselves, but I'd rather do it in my plugin. ...
0 votes
0 answers
6 views

How to remove space between header and table in widget?

The answer might be obvious since I am not big into web development. I noticed that tables have some space at the top that paragraphs don't have (both are preceded by a h2). How can I remove said ...
1 vote
1 answer
2k views

Which directory should be writable to update wordpress?

I configured file permissions according to here like this. apache user runs server and wordpress user owns directory, this user is only used for this site. drwxr-xr-x 5 wordpress wordpress 4096 ...
1 vote
0 answers
13 views

WordPress notification if new post published

I use WordPress and I want to alert users if new post with post_type = job_post was published. Also I want to show amount of new post. So I add to function.php global $new_job_count = 0; function ...
0 votes
0 answers
17 views

Wordpress site identation issue

i hired someone whileback to build me a WordPress site https://printersvalley.com/ . But the site has a issue with indentation. The posts are not in proper lining can someone tell me how to do it ? or ...
1 vote
2 answers
1k views

Is it possible to display tag cloud widget by category?

Is it possible that Tag Cloud Widget will show only tags by category? If a single post is from sports category, then the Tag Cloud Widget will only show tags about sports.
0 votes
0 answers
15 views

Unusual Folder Structure On WP Install [closed]

I’m going to potentially be looking after a WP site, and it has a folder structure I’ve never seen before. Instead of the normal wp-content > themes > themename the main WordPress install seems ...
0 votes
1 answer
17 views

Send Array from JS to php file then insert it in wp database through a plugin

This's my code it's success but when but I can't the return data from ajax in the same page. the mechanism is the user click the dropbox button and when he selects it returns dropbox_links and then ...
1 vote
1 answer
870 views

How to pass a message using template_redirect

I'm using the following function to redirect a post to another using custom field. It's working just fine until I added the line#8 to pass an ID so that I can grab it in to the post (to where was ...
0 votes
1 answer
598 views

How to write to a text file and save it in a folder for later download?

I've a template file in the 'templates' folder that performs a function based on the JSON input it receives from an external source. I want to write that JSON input in a text file and save it ...
0 votes
0 answers
21 views

Inject "fake" category to widget/block

I have a regular categories widget (or "block" in the new terminology), that creates a <ul> with my categories. I want to add a fake category for linkbuilding reasons, an entry to ...
1 vote
1 answer
1k views

How to organize priority of plugins CSS files?

I'm developing website with theme (Astra Pro with child theme) and plugins. While I'm checking my performance in Chrome Dev Tools trace shows non-critical stylesheets with high priority. Example — ...
34 votes
6 answers
81k views

How do I get only the image URL from the_post_thumbnail()?

I want to know how to get just the image URL from the_post_thumbnail(). The default output of the_post_thumbnail() is: <img width="800" height="533" src="http://example.com/...
31 votes
3 answers
50k views

How to use Wordpress Multisite With Different Domain Names?

I want to work with WordPress multisite, but I want to be able to use my own names. For example my main site is called example.com. If I want to add a new site to my multisite network it's gonna be ...
1 vote
1 answer
9k views

Pagination on category page with custom post types

Wordpress is not new for me but I am really stuck on this piece of code that I can not get to work properly. I register a custom post type News and let the custom post type use the Wordpress ...
20 votes
13 answers
26k views

Cookies in multisite where network sites have their own domain name

I decided to integrate several stand alone WordPress websites into a single multisite installation. I created a brand new multisite install with subdirectories, created a MU network site with ...
0 votes
1 answer
734 views

woocommerce: when adding or removing items to cart , it takes cart a few seconds to read changes?

I have the most simple cart page . [woocommerce_cart] that is it. when I add products to pages and view cart it shows the cart empty , afew refreshes (after afew seconds) the cart populates . when ...
0 votes
0 answers
6 views

Remove parent category from child/sub-category page URL in Wordpress

I want to remove the parent category from sub-category page URL. (acuually I need it only for a specific parent-category) f.e, convert the URL of all sub-categories pages under this parent-category, ...
0 votes
0 answers
8 views

What are the best WordPress plugins for using WebP images? [closed]

Looking for the best WordPress plugins for using WebP images. I want to optimize new images, but also images that are already uploaded to the website.
0 votes
0 answers
10 views

Commercial checkbox in Wordpress registration form [closed]

I'm building a website and I need a checkbox in the registration form ir order to know if the user wants to receive commercial communications. I also need to save that information in the user profile ...
1 vote
2 answers
666 views

twentyeleven_content_nav hook no longer outputs navigation link after 3.5 upgrade

After upgrading to 3.5, I discovered that navigation has disappeared outside of the main index page. Theme is TwentyEleven and I've verified that this still occurs after disabling all plugins. <?...
0 votes
0 answers
12 views

how to create hierachial taxonomy and manage under single post type?

i have created Farmers Post type for managing farmers data in wordpress. now i want to create hierarchical taxonomy as below: ->state ->district ->g.panchayat ->village ->farmers Please ...
1 vote
1 answer
1k views

Is this best practice for Dynamically adding items to WordPress menus?

Is there an easier way too add this functionality to the menus page, instead of using the following code? Another words a different filter/hook/action that will make it, so I don't have to write ...
0 votes
1 answer
9 views

register custom post inside a custom post

suppose I made a custom post named 'event' , and now i have to add another custom post type inside a the event named 'organiser'. Hello. I created a custom post type as ‘events’. I want to display ...
0 votes
0 answers
12 views

Sharing variables in both actions wp_footer and wp_ajax

I have some code in my functions.php that, under a specific time condition, showes a popup that notices about some database update routine. What is happening here, is that when this condition happens, ...
0 votes
1 answer
14 views

check that the data exists before sending it to wpdb

When I send data to wpdb from form I can have some empty fields. How can I add conditions to array of data inside array or before insert wpdb to send only filled fields ? The fields concerned (for ...
3 votes
1 answer
686 views

Scheduled Posts and wp-cron - Why don't scheduled posts publish if too old?

I notice that the documentation for wp_schedule_single_event mentions the following:- The action will fire off when someone visits your WordPress site, if the schedule time has passed. However ...
0 votes
1 answer
12 views

I need some CSS to get the following aligned [closed]

I'm using the post widget from Jetengine which is great because it let's me add custom fields easily however it's lacking a huge option for me which is the option to set the images to cover so the ...
0 votes
1 answer
12 views

Auto Generate Post Title from 2 Custom Fields

I would like to generate the post title from 2 custom fields, 'job', which is a taxonomy, plus 'date' which is a date picker, not the date of the post. This is for a custom post type called 'job-...
0 votes
1 answer
1k views

Create new custom field that calculates age

I have a wordpress site with custom post types that are people. They include a variety of custom field descriptors - one of which is Date of bith. I have the date of birth field in place (via ...

15 30 50 per page
1
2 3 4 5
2252