Questions tagged [codex]
Online manual for WordPress and a repository for WordPress information and documentation.
94 questions
0 votes
1 answer
58 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 ...
0 votes
1 answer
69 views
How to use filter in this situation, can not modify the structure using filter
plugins/idx-broker-platinum/idx/shortcodes/register-impress-shortcodes.php This is the plugin file where I need to use a filter to override the structure. Filter name: impress_showcase_property_html ...
1 vote
1 answer
124 views
What is the reason to use function strings for callbacks
Throughout the WordPress documentation I see callbacks being inserted as strings instead of function variables or closures. Let me examplify that; function wpdocs_my_save_posts( $post_ID, $post, $...
0 votes
1 answer
147 views
Next/Previous Url only
I only want to get the URL of the next/previous post link instead of title+link. I searched WP's codex but unfortunately, I couldn't find it. Any ideas?
0 votes
1 answer
68 views
get_page_by_title() doesn't return the post object if the title has inverted comma (')
The question is self-explanatory. I have tried these so far. I have a post named John's Test with post id 1. In single.php, I tried, $extraPostID = 1; $extraContent = get_page_by_title(get_the_title($...
2 votes
1 answer
97 views
*Just curious* I erroneously used hook add_action() instead of add_filter() and there was no error and the result was correct. Why is that?
While working on a project I used the incorrect hook type add_action() which does not exist, yet there was no error notice and the correct result returned. I only realized it was wrong while searching ...
0 votes
0 answers
57 views
Using Json Schema with wordpress codex
I have a json schema code that I need to use it for all posts <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "...
0 votes
1 answer
419 views
How do I define and register a shortcode function in a namespaced functions.php file?
I wrote a function in my theme's functions.php and am attempting to register it with add_shortcode() as shown in the Codex: <?php /** * theme's functions.php */ namespace MyNamespace; //[foobar]...
1 vote
0 answers
101 views
Multiple Images/ Slider with custom post [single.php] [closed]
I am looking for a approach to add multiple images option under the Feature image section in wordPress custom post type. I will integrate/implement these images on single.php file where I want to show ...
0 votes
0 answers
48 views
adding category and tags to admin plugins menu
How to create a tag and category for plugins just like the function shown below performs for pages? function add_categories_to_pages() { register_taxonomy_for_object_type( 'category', 'page' ); } ...
0 votes
1 answer
358 views
What are the available options for "Name" in WP search?
I am trying to find the list of available values for name in the search to filter results. So far I have found name="s" is the default name="cat" is for categories and name="post_type" is for post ...
0 votes
1 answer
99 views
how do i add customizer edit option without plugin in wp
when i go to wp customizer then i want edit the name popular and cat_id =21 <div class="p_list"><h2><span>popular</span></h2> <?php $first = true; ?> <?...
1 vote
1 answer
64 views
Wordpress Codex has different number of arguments for get_previous_post and get_next_post functions. Why?
Compare the following two links: https://codex.wordpress.org/Function_Reference/get_next_post https://codex.wordpress.org/Function_Reference/get_previous_post The get_previous_post function doesn't ...
0 votes
2 answers
1k views
WP_Query for custom post type and category_id not working
I am tring to implement custom filter for The Event Calendar. I have used this code $args = array( 'post_type' => 'tribe_events', 'meta_key' => '_EventStartDate', 'meta_query' => ...
0 votes
1 answer
225 views
How to disable Wp-Page Navigation on Blank Search in Wordpress
Im using the Following Code in search.php <?php if (have_posts() && strlen( trim(get_search_query()) ) != 0 ) : while (have_posts()) : the_post(); ?> <?php endwhile; else:?> <...