A type of hook that provides a way for content to be overridden programatically

learn more… | top users | synonyms (5)

6
votes
1answer
2k views

How to add sub-menu to a menu generated by wp_nav_menu by using plugin

I have a menu generated by wp_nav_menu which look like <ul class="nav-menu" id="menu-top-nav"> <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-43" ...
2
votes
1answer
83 views

Using hooks to place content in theme dynamically

Alright, so I think I may be getting a little too complicated on this, but I basically want to know if this is possible. I am using a content slide function where I display some thumbnails within the ...
2
votes
1answer
379 views

Refine/Filter WP_Query Posts with jQuery or Ajax

I know this has been asked many many times, but I literally searched for an answer for more than 5 hours without finding anything that drives me in the right direction. What I'm trying to achieve is ...
2
votes
1answer
390 views

Gravity Forms field entries into wp_query loop

I have a simple function that filters the page content when form (ID 18) is submitted. It simply displays the entry of field (ID 13)... add_action("gform_after_submission_18", "set_post_content", 10, ...
2
votes
1answer
103 views

Trying to wrap <span> around first word of multiple word strings with a widget_title() filter, only works on two word strings and not more than two

I am trying to wrap a around the first word of multiple word widget titles. I have used the answer from here: ...
2
votes
1answer
169 views

Proper use of the_content filtering

This is a bit difficult without posting scads of code, but my question is: What are the benefits of filtering through apply_filters('the_content', 'anything');, and given my example loop, am I ...
1
vote
1answer
26 views

Hook Into the_content Filter For JSON API Only

I'm trying to figure out a way to remove the shortcodes from my JSON output which I'm using the Wordpress JSON API for. I need to remove the shortcodes from the content before do_shortcode is applied ...
1
vote
1answer
41 views

post_row_actions filter is not working while update post using quick edit

I have created two links using post_row_actions, it was displaying fine when page loads. But the links will get disappear after update post using quick-edit. Is it a bug from WordPress or did I miss ...
1
vote
1answer
69 views

Filtering the post list in the admin area

How can I filter my custom post type like it's filtered by WordPress itself? By that I mean the links that allow you to show only published, private or trashed posts. I need it because I want to ...
1
vote
1answer
103 views

Add Lightbox To WordPress Native Gallery

Is there a way to check if a gallery is linked to an attachment page or to an image file via jQuery or WP filter? I'm trying to add a lightbox to gallery image that is linked to image file. But I ...
1
vote
1answer
69 views

How to use manage_$post_type_posts_columns with underscore in post type?

I have a post type 'job_listing' and I want to use manage_{$post_type}_posts_columns filter in it. I tried manage_job_listing_posts_columns but it's not working because of the underscore in the post ...
1
vote
1answer
161 views

How can I replace an oEmbed URL in post with actual embed HTML

What I want is to get the output of the Twitter oEmbed system into my actual posts. IMHO the embed output itself is high-quality, semantic HTML and I'd rather have it inside the post than in the embed ...
1
vote
1answer
134 views

Set Item Order with wp_nav_menu_{$menu->slug}_items

I have some code that adds a menu item to a menu using wp_nav_menu_{$menu->slug}_items. It's pretty easy to add a menu item as the first or last item of the menu, but I was wondering if there's ...
1
vote
1answer
143 views

add img class to native wordpress galleries

Trying to add an img class = "the image alt field" to the images in a native wordpress gallery so i can use jquery isotope to filter the gallery. I could use the image alt field or the description ...
1
vote
1answer
256 views

Filter list by a unique meta value dilemma

I'm been racking my head at this for a while now, and I can't figure out how to fix the code. Here's the issue; I found a snippet of code online to filter my post results in edit.php based on ...
1
vote
1answer
154 views

list category posts under its item in menu

When adding category to Menu, I need it to list all the item that belong to that category in separate UL automatically. like this http://i.stack.imgur.com/ulOOS.jpg Of course I can do that manually, ...
1
vote
1answer
230 views

display only the wp_nav_menu, which has the current-menu-item

i have a problem displaying only the menu with wp_nav_menu, in which the current-menu-item is in. Heres what i got: function register_menus() { register_nav_menus( array( 'sidebar-menu' ...
1
vote
1answer
2k views

ajax for filtering posts by category in wordpress loops

I've been looking around for a way to filter my posts on http://www.waziproject.com/wazimagazine/ without reloading the page. So my question is if anyone can help me out to turn the following into a ...
1
vote
1answer
101 views

Give “Read More” precedence over excerpt() word count

By default, the_excerpt() displays the content before the <!--more-->, trimming it at ~50 words. Is there any way to prevent this trimming functionality when the <!--more--> is present, ...
1
vote
1answer
127 views

Admin comments and user restrictions

I have set a bunch of roles within wordpress with the help of the "members" plugin. But the capabilities regarding the comments moderation are very limited ("manage_others_comments" or not) What I ...
1
vote
1answer
104 views

Wordpress Image update filter

I can't seem to find the filter for an image update. Right now I have the code below, which works great until someone clicks on an image in the editor and updates it. Then it throws the height and ...
1
vote
1answer
50 views

Run wp_kses_decode_entities on atom feed?

I would like to convert the htmlentities in only my atom feed to their corresponding characters. Using the below in my functions.php I've gotten close, but obviously the commented out line doesn't ...
0
votes
1answer
10 views

add class to internal links in content

i want to add a class to all links inside of the_content, that point to other interal content, f.ex. other posts and pages. i want to do this automatically. dunno if the best practise would be, to ...
0
votes
1answer
8 views

using posts_where for meta data on pre_get_posts

Let's say you have some code which filters posts by using pre_get_posts e.g. add_action( 'pre_get_posts', 'be_exclude_category_from_blog' ); function be_exclude_category_from_blog( $query ) { ...
0
votes
1answer
36 views

passing '&' in return function of add_filter

I have below line in my return function of add_filter in wordpress. add_filter('the_content', 'my_drama_func'); function my_drama_func () { return "function getthrough() { jQuery.ajax({ ...
0
votes
1answer
29 views

Add Class to a div using a filter?

is it possible to add a dynamic class to a div using a filter in the functions.php? I know it's possible for the body-tag - also for a custom defined div with an id? if ( !is_search() ) { ...
0
votes
1answer
19 views

How to add a filter to get_the_author_meta?

I need to filter calls to get_the_author_meta() but I haven't been able to do it. I'm using a plugin which uses this function: get_the_author_meta('display_name', $p->uid)` I need to be able to ...
0
votes
1answer
21 views

Filtering more than one term in a taxonomy in WP

i have a custom post type called 'events', it has a taxonomy named 'category' structured this way: hotels (parent) -1 star (child) -2 stars (child) -3 stars (child) location (parent) ...
0
votes
1answer
30 views

Print all inline styles to head

Currently working on a project here http://palanquin.shrimp-works.com. When I try to validate what I have done so far, using http://validator.w3.org/, I get lots of this error Element style not ...
0
votes
1answer
40 views

Underscores and capitalization in usernames

I created a WordPress / BuddyPress / bbPress site that is used in conjunction with a PC game. When users register for the site, they are asked to enter their account name as it is in-game. The problem ...
0
votes
1answer
78 views

Select All not working in a WordPress search filter

I am trying to create a Search Filter within WordPress to filter through all the custom taxonomies within a Custom Post Type. I have created a function that generates the dropdown so I can output ...
0
votes
1answer
17 views

Filter the HTML content of plugin

I am using the Marketpress plugin. I want to modify single_order_funct() function HTML content in it. I want to make changes so that, when it is updated, I don't lose them. class PluginClass{ ...
0
votes
1answer
17 views

Activate short codes for all post queries?

I need to use shortcodes on widgets and various plugins. For widgets I simply used: add_filter('widget_title', 'do_shortcode'); add_filter('widget_text', 'do_shortcode'); However I cannot figure ...
0
votes
1answer
44 views

change output location of plugin function using a custom hook

I'm running the YouTube Video Fetcher plugin and it fetches youtube videos and displays it on your website. However, instead of displaying the video after the post, I want to hook the code into a ...
0
votes
1answer
64 views

filter single_cat_title avoiding the breadcrumbs

I'm developing a simple plug in and I need to filter single_cat_title in category page adding some html in every category page. Just doing this: function subtitleCategory ($title) { return ...
0
votes
1answer
41 views

Save something to global var in add_filter

I am here again with a strange question. First, I'm using ACF plugin for adding cistom fields. My code looks somethink like that: global $testMe; $testMe = 0; function my_acf_update_value( $value, ...
0
votes
1answer
83 views

Wordpress URL rewrite problem

blog.com/product/somename In the above URL - how do I tell Wordpress that 'product' is a variable and 'somename' is its value. Then how do I extract that value and use it inside a function I'll ...
0
votes
1answer
26 views

How to remove shortcode(s) from WYSIWYG Page editor for Non Admins

Title says it all. We have a front end form on our site where users submit content via front end (also they are logged in while doing this) Because these short codes add them self to the content box ...
0
votes
1answer
37 views

query post based on comparison

Each post in my site can be rated as 'good' , 'ok' , 'bad'. The values are stored in custom fields. I now need to show top 10 posts with maximum 'good' and it should not display posts with greater ...
0
votes
1answer
42 views

wp_get_attachment_link filter not working

I'm trying to modify all image attachment links to include a rel value thus: add_filter( 'wp_get_attachment_link', 'my_prettyadd', 100, 6); function my_prettyadd( $markup, $id, $size, $permalink, ...
0
votes
1answer
33 views

Restrict a filter to a custom post type. Am I doing this right?

So I had this little bit of code to short a music charts custom post type that all starts with numbers (the trick was to make the 10th position appear last in the list, not between 1 and 2): ...
0
votes
0answers
191 views

Pass parameter to the upload_dir filter

I'm trying to figure out a better way to pass a parameter to the function I am using with the upload_dir filter. Currently I have only gotten it to work by using sessions and/or cookie that I erase ...
0
votes
0answers
646 views

Add jQuery Validation in Gravity Forms Form

So I have some jQuery functions that adjust my column layout on window load and window resize. They are inside a file called bp-columns.js that looks like this: jQuery(window).load(function () { ...
0
votes
0answers
59 views

How to create filter for site

Good afternoon. Learning WordPress, I would like tips on how to make the filter on my website (not in the admin panel). For custom fields using magic fields 2 to display all the records I've just ...
0
votes
0answers
116 views

Include a page template along with add_theme_support()

I'm not even sure this is possible but before I start thinking up crazy solutions, I'll see if there is a WordPress way to do it. Here's the deal. I have a timeline jQuery plugin all set up on ...
0
votes
0answers
179 views

Disable Filter and Allow Embed/iFrame on Blogger Import

I'm trying to import blogger posts into a wordpress site but all embedded audio/video content is getting filtered out. I've commented out the following in kses.php: // Post filtering ...
0
votes
0answers
136 views

Can't update an option when the publish_post action is fired.

I'm using Tom McFarlin's Plugin Boilerplate, and I'm facing this huge problem where I can't update an option when the publish_post action is fired. I have a function that hooks into the publish post ...
0
votes
0answers
372 views

Filter posts by multiple checkbox categories

I would like to set up a widget to filter my post by categories. Let's say, I do have two different categories, "Countries" and "length of stay" with sub categories. Here is an example of what I have: ...
0
votes
0answers
290 views

Custom excerpt_more filter not working when <!--more--> tag is present

I'm doing this inside Thesis 2, in case that matters. I am using the_excerpt(); on my blog page to get the posts. And I'm using two custom filters: function custom_excerpt_length( $length ) { ...
0
votes
0answers
264 views

custom styling for woocommerce categories

I am using hooks and customizing the template files to use woocommerce. On my products page I want a list of categories along the top like this. I would even settle for a neat list of them where my ...