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.

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

I'm resurrecting two older Q&As in this question to ask: is it possible to show exact search results which includes comments? Without any plugins? This function is from an older Q&A Incude ...
BlueDogRanch's user avatar
1 vote
0 answers
66 views

I need to setup a cron task in order to generate a list of bookings.ics from my Bookings Calendar plugin. My function which is located inside my functions.php is this one. It is processing my bookings ...
Oris Sin's user avatar
  • 113
0 votes
1 answer
76 views

if ( !function_exists( 'my_function' ) ) { // do function } I'm not sure why, but it never occurred to me before to make a theme fully pluggable so that it's easier for people to customize with a ...
WPdummy's user avatar
  • 23
0 votes
1 answer
76 views

I have a grouped metaxbox values from cmb2, when I return it to display output, it shows only one of them, but actually it has four value stored. How could I display all grouped metabox value? Here is ...
user9637601's user avatar
0 votes
1 answer
53 views

I would like to run and store the value returned from a python script, in response to certain admin actions. I've tried a bunch of suggested solutions but the only method that has worked for me is: $...
Fluxian's user avatar
  • 182
0 votes
1 answer
53 views

I have imported some blog posts from an external site and there were unnecessary html tags and values I wanted to get rid of like the sizes and srcset including their values for all blog posts. It ...
Bry Ledesma's user avatar
0 votes
0 answers
30 views

I set the logo size to 200px 200px but on the site logo is bigger. It is set to image size 626px 626px function theme_support() { $defaults = array( 'height' => 200, ...
Jorpy's user avatar
  • 101
0 votes
1 answer
91 views

I’m using Gravity Forms to allow users to register on my WordPress site. I’ve added a file upload field (ID: 6) for users to upload their avatar. I want to set this uploaded image as the user’s ...
Raman's user avatar
  • 1
0 votes
0 answers
30 views

When I share my website link on groupme it shows my author name. I have changed my nickname to the website name and it has not changed. I have downloaded plugins to hide the metadata and so on. I also ...
Dona Chong's user avatar
0 votes
1 answer
35 views

I am using the wp-hotelier plugin. The /booking page displays $checkin and $checkout dates/times in a user-friendly format (e.g 30 January 2025 (12:00 - 21:00) / 31 January 2025 (08:00 - 13:00))... ...
playedandmissed's user avatar
1 vote
1 answer
92 views

For example: ERROR: Invalid email address. Lost your password? I want to catch it and show my own message instead. I can edit user.php in WordPress but I don't want to touch base (core) WP files.
webstackoverload's user avatar
3 votes
1 answer
197 views

I'm trying to set up a "fall back" query for wp_query. I want to get the first post that is one year old, but if that doesn't exist, get the first post that is one year and one day old. And, ...
BlueDogRanch's user avatar
1 vote
0 answers
72 views

I have read thru Gravity Forms docs, forum posts, et al and cannot find a way to target the Checkbox container element, and checkbox wrapper DIVs to add specific classes to them. My goal is to ...
revive's user avatar
  • 235
0 votes
1 answer
45 views

I have set up custom thumbnail sizes in my functions.php, as follows: function df_theme_support() { add_theme_support('post-thumbnails'); //Custom image sizes add_image_size('small-thumbnail', ...
dfr's user avatar
  • 35
1 vote
0 answers
81 views

I'm using Elementor and ACF on a website and have a custom post type for events. In elementor I have the posts on the archive page set to order by the ACF start date field. When the user clicks the ...
kemmieg's user avatar
  • 31
0 votes
0 answers
26 views

You provided an answer on the below post, I wanted to ask if this should work on Wordpress posts or pages, Im trying to do something similar for posts but I added your code to functions.php and it ...
Steve's user avatar
  • 1
0 votes
1 answer
33 views

I want to limit this in the WP admin: Show only own comments (given to users who wrote/published/assigned) posts (Admins excluded). also the filters numbers will be assigned to user posts not as im ...
Kareem's user avatar
  • 3
3 votes
3 answers
146 views

This might be kind of funky to pull off, but does anyone have any ideas on how I could automatically set the time to 8am on any newly created post drafts? In both the Classic Editor and the Block ...
BlueDogRanch's user avatar
0 votes
1 answer
55 views

I'm stuck, and haven't been able to find an answer after much searching. I need to modify the User Admin Panel showing the list of users and the number of posts. I have custom posts (type = 'articles')...
Reekes's user avatar
  • 3
0 votes
1 answer
42 views

I have the following code: function auto_link_post_titles( $content, $post_id, $field ) { $excluded_ids = array(); // Put the IDs of the pages you want to exclude here $excluded_field_names = ...
Mapa's user avatar
  • 19
0 votes
1 answer
50 views

I need a Data Layer in my WordPress header.php. It's already running by author like this: <?php $author_id = get_post_field('post_author', get_queried_object_id()); if (get_the_author_meta('...
Job's user avatar
  • 3
1 vote
1 answer
47 views

I have the following code: function auto_link_post_titles( $content ) { // Sets the post type(s) we'll retrieve. $desired_post_types = array( 'my_post_type', 'my_other_post_type' ); // ...
Mapa's user avatar
  • 19
0 votes
1 answer
78 views

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
1 answer
110 views

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
1 answer
55 views

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

1
2 3 4 5
116