Skip to main content

Questions tagged [functions]

A function is a sequence of program instructions that perform a specific task. It is packaged as a unit that can be used wherever the according task should be performed.

0 votes
1 answer
7 views

Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder

I am getting the following error: Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. I have gone through plenty of other similar questions ...
Aristocles's user avatar
0 votes
0 answers
5 views

How to combine Wisechat & membership/subscription plugin [closed]

New here and have been trying to find an answer on how to develop a function for my site. I want to have a live running chat for visitors (wisechat) however participation in the chat will be limited ...
JBMills's user avatar
0 votes
0 answers
8 views

How am i able to share a product sku with a variant of the same product with same sku without errors so inventory sync on whichever is bought? [closed]

The Title says it all. How can I share a product SKU with a variant of the same product with the same SKU without errors so inventory syncs on whichever is bought? I am trying to have some candle ...
Selected Scent's user avatar
0 votes
0 answers
29 views

Removing website URL in comments causes misalignment of submit button and tickbox

I am using Astra free theme, I have created a child theme with functions.php, comments.php, style.css. I have managed to remove the Wesbite URL entry using the following code in functions.php: ...
kira123's user avatar
0 votes
2 answers
38 views

Split titles by the " - " in Wordpress

I wanted to divide a Wordpress post title by the hyphen, in PHP and HTML in a Wordpress page for different div's. Here's an example of the title i wanna divide "Charli XCX ft. Billie Eilish - ...
Daniel Martins's user avatar
0 votes
1 answer
18 views

Function to filter numbers from string

I'm looking to filter numbers from a string, and make them bigger in one case, and hide them in the other. The best way, as I understood, would be to use a custom function via functions.php and ...
Majtres's user avatar
0 votes
0 answers
9 views

Hreflang Tags from the Most Recent Post Appearing in Category Page Headers

I'm encountering an issue on my WordPress site where the hreflang tags from the most recent post are being displayed in the html header of category pages. This causes the category pages to have ...
Numb3r_0n3's user avatar
0 votes
1 answer
21 views

How to access a function declared in child theme's functions file in a plugin file?

I have a function declared in my child theme's functions.php file as seen below: function test_fn(){ error_log("Test fn"); } When I am calling this function in a plugin file, I am getting ...
dc09's user avatar
  • 195
0 votes
0 answers
16 views

Would it be possible to disable embeds for specific user roles? If so, how?

I would like to disable embeds for specific custom user roles. I found this solution to disable embeds from WPPagebuilders: function my_deregister_scripts(){ wp_dequeue_script( 'wp-embed' ); } ...
TomatoBisque's user avatar
0 votes
0 answers
12 views

How can I able to exclude 'Category' and 'Tag' slug from the URL in Wordpress without reloading to new site?

in functions.php, I wrote this code: function remove_category($link) { if (!is_admin() && (is_category() || is_tag())) { $category = get_queried_object(); $...
user242793's user avatar
0 votes
0 answers
13 views

require used as a function to load theme dependencies?

I've inherited a site from another company recently and found this in their functions.php file: function themeLoader() { locate_template(include('inc/wp_reset.php'), true, true); locate_template(...
Adam Taylor's user avatar
0 votes
0 answers
7 views

How to trigger an update_option

I'm trying to update option_name values from my form fields on form submission // Update value from wp_options 'oxymade_colors' name (--primary-color) // Used to update the rgb color $color_mappings ...
Paolo Montalto's user avatar
0 votes
0 answers
13 views

Remove posts that start with similar words (like a delete duplicate posts plugin)

Can anyone advise on a SQL query or plugin (or any other solution, as I haven't been able to find any) that can delete all posts that start with the same words, except the oldest of them? Or maybe to ...
Johnny Bravo's user avatar
0 votes
0 answers
21 views

Put ACF function output code the_terms

I would like to put an ACF field in the of my the_terms function, is this possible? Because I can't figure out how to put it. <?php $dev = get_field ('my_field', 'option');?> <?php ...
user avatar
0 votes
1 answer
24 views

is there a list of actions on Wordpress

Often, I see a lot of useful functions under "add_action" for example "plugins_loaded", "admin_init", "show_user_profile", etc. Is there a website or similar ...
Rodrigo Moya's user avatar

15 30 50 per page
1
2 3 4 5
384