0
votes
1answer
28 views

Adding body class when post contains a specific shortcode

Simple shortcode function : function my_shortcode_function($atts,$content=null){ // Do something return $content; } add_shortcode('my_shortcode','my_shortcode_function'); I wonder how to add ...
0
votes
0answers
11 views

function triggered by “manage_users_custom_column” filter not working

I am trying to add a custom column un users.php but it stays empty. I have successfully added a column to the users admin page with this code in my theme's functions.php file: function ...
0
votes
1answer
30 views

relation OR instead of AND - Filtered term ID's in loop

Question not related anymore.. First I tought about the relation OR/ AND for results, but I believe I should work with 'operator' => 'NOT IN'. I would like to query the results that meet multiple ...
5
votes
2answers
62 views

Remove Actions/Filters added via Anonymous Functions

That's a freaking bad practice I must say. Spent last two hours finding a solution to remove actions and filters added via Anonymous functions. This is the code used on a Parent Theme, and I need ...
0
votes
1answer
26 views

Add Element as a Filter to the_content

Can I and How would I add a filter in the function.php that would add a HTML element around the content when the_content is used? This would be similar to what you can do with the_title. i.e: ...
0
votes
1answer
26 views

Allow tags and attributes in post and pages content

I am trying to allow the "onclick" attribute on links as well as some html tags such as iframe to the content displayed in posts and pages. In my theme's functions.php file, I tried removing ...
-1
votes
1answer
76 views

Hueman layout styles and custom post type (DW Q&A)

I'm running a wp site with the Hueman Theme and the Q&A plugin from DW. The theme doesn't really plays well with the theme, so I had to find some solution for it. Managing the is somewhat painful ...
0
votes
1answer
13 views

search form leads to 404

I'm using the follow code in my functions.php to add a search box to my primary nav menu - add_filter('wp_nav_menu_items','add_search_box_to_menu', 10, 2); function add_search_box_to_menu( ...
0
votes
2answers
30 views

Override the Wordpress core function wp_referer_field

I'd like to override the core Wordpress function wp_referer_field to change the value of $referer_field variable inside of it. I've found that wp_referer_field is not pluggable and that I need to ...
1
vote
0answers
78 views

Woocommerce - sort by discount in dropdown menu - woocommerce_get_catalog_ordering_args [on hold]

I have searched and searched for a solution for adding a "Sort by Discount" to the dropdown on the shop page in woocommerce. I need to add a calculation such as this somewhere: $percentage= ...
1
vote
1answer
47 views

How to overwrite youtube embed?

I really like how you can just paste a URL right into the post... such as: http://youtube.com/watch?v=xyz or http://vimeo.com/123456 What I want to do is change the default code for this to support ...
1
vote
1answer
133 views

Super simple shortcode not working

Have been looking at various tutorials and answers here and elsewhere and just can't get this to work. Just trying to display a simple output from a shortcode as below, but it is just outputting the ...
0
votes
0answers
43 views

WordPress Visual Editor Filter for Visual View

I have setup custom HTML to be created when a user inserts media using "Add Media" in WordPress using the code below: add_filter('get_image_tag', 'add_image_frames', 10, 6); function ...
4
votes
3answers
120 views

How to restrict actions and filters “properly” by conditions

Which one is correct when adding actions/filters/etc.... Both methods work fine and I've seen people do things both ways, but I'm assuming one is correct. My gut tells me that wrapping the if ...
-1
votes
1answer
28 views

AJAX: Wordpress filters inside $html do not work as intended

I am sending HTML content through some AJAX magic and while everything is working as I wish, the output gives something along those lines in the page: "http://permalink.comtitle" It's as if all the ...
0
votes
4answers
541 views

Programmatically Add Font-Awesome Icons to Category Widget

I use the Categories widget on my sidebar(s) and I would like to display a Font Awesome icon next to each category listed in the widget. The icon would be the same for all categories, for now, but I ...
0
votes
0answers
38 views

making a glossary with wordpress

I know that there are glossary plugins in the wordpress repository. This plugins normally searches glossary terms in post content and adds a link to it. But i have not found one, that search and ...
1
vote
1answer
49 views

Get current page_id before loop, in functions.php

In the Shoestrap theme, you often change content by using hooks. I want to add the following to functions.php but it doesn't work... // in functions.php if ( is_home() ) { add_action( ...
0
votes
1answer
63 views

How to edit classes in body tag?

I'm trying to edit classes in the body tag for custom post types so I can display the pages full width using the WooThemes Canvas built in full width class - instead of overriding it. By default it ...
0
votes
1answer
89 views

How to add nav menu items to a specific position within a menu

I'm adding login/logout links to a nav menu using the following code: function rp_add_login_logout_links( $items, $args ) { $link = wp_loginout( get_permalink( get_option( ...
2
votes
1answer
37 views

How do I know what variables are passed in a filter/action and what their meaning is?

Something I have seen several times now and I don't understand is the following: In a theme's functions.php a function is defined and then attached to a hook, like so (simplified example): function ...
1
vote
2answers
29 views

How would go about if I just want a temporary function?

How would go about if I just want a temporary function? (It's a converter just for converting Access to Wordpress tables). I want to execute several times so therefore I want it automated, but I don't ...
0
votes
1answer
20 views

child_of not working while searching

I'm trying to limit search to a parent page and its own child pages. I've changed searchform.php adding this code: <input type="hidden" value="<?php global $post; $ancestors2 = ...
0
votes
1answer
237 views

Remove a particular State from Woocommerce Checkout List

I am attempting to remove a single state from the woocommerce checkout page. I've found the file in woocommerce core that I can edit to remove the state, but I would prefer to do it through a theme ...
1
vote
1answer
74 views

Change the footer text on the login page

I am customising the login page and would like to alter the footer text that takes the user back to the website. Ideally and as an example, changing it from the first image, to the second just below: ...
0
votes
1answer
256 views

Modify post filter to set custom number of posts per page and exclude child posts

I have a custom post type called "galleries," which is hierarchical. I'm using a function in my functions.php file to modify the number of posts displayed per page to 48. That part works fine, but I ...
1
vote
1answer
152 views

Add body class of category parent

I am not a coder, but I usually get by with Wordpress by doing my research and find my solution. I can't find what I need to do this time so I have attempted to crib together some code - what I am ...
1
vote
2answers
162 views

Passing values from a widget to a function within a plugin

I have a plugin that is built with many widgets. A widget's bundle. Each widget creates it's own custom CSS code. Instead of having messy source code where I display 15 different sets of inline CSS ...
0
votes
1answer
57 views

How to set default values for edit_post_link() in my theme?

How do I set default values for the edit_post_link function in my theme? I'd like to change the 'Edit This' string to a custom value, but specify this only once, so I can use instead of everywhere. ...
0
votes
1answer
166 views

Using add_filter() in Widgets

Just have a query reference the add_filter() function. Can you use this function inside a WordPress widget class. Example I have a widget with dynamic created code that I want to pass to another ...
0
votes
1answer
141 views

Can't change excerpt length and more tag

I tried to change the excerpt length and the more tag the way it is described in the codex: function custom_excerpt_length( $length ) { return 10; } add_filter( 'excerpt_length', ...
2
votes
1answer
192 views

WooCommerce product search titles only

I had asked this earlier and solved it using the Relevanssi plugin, however that plugin is now breaking things so I can't use it anymore. How is something so freaking simple made so impossible by ...
0
votes
2answers
230 views

How to change a certain text or term of WordPress into a custom into the whole site?

In my WordPess site for client, I used Posts as Products, Comments as Customer Review, Subscribers as Registered Customers and so on. For client's I used Admin Menu Editor to edit the wp-admin menu ...
3
votes
1answer
218 views

Determine which theme location a wp_get_nav_menu_items is for

Is there a way to determine which theme placement a menu is for when modifying it with the wp_get_nav_menu_items filter hook? I'd like to only add items to certain menus and I don't want to have to ...
0
votes
1answer
42 views

Search box background on a different page template

I'm trying to make the search box background the same as the homepage, but for some reason there is a orange background - it doesn't use a different header.php its called within a filter the code ...
0
votes
1answer
339 views

Only let plugin add actions to wp_head & wp_footer on single posts

I'm using a a plugin (Comments Evolved) on a recently built site. The issue I'm having is that this plugin globally enqueueing and adding actions to the head and footer of all pages. I'd like to ...
0
votes
2answers
30 views

Deleting Certain terms from appearing on the front end as links

I've put some thought into this but Can't really figure out what direction I take in getting rid of certain terms in my testimonial_category called 'home', 'homeone', hometwo. I only want to stop ...
0
votes
1answer
51 views

how to add_filter to non hook function

the idea is apply some filters if the user select the option in the theme, but i have a problem i made a function that replace the post_thumbnail_html for a personalized html then, i create other ...
0
votes
1answer
160 views

apply_filters to featured image

I have a page where I have embedded the page using these lines of codes at function.php: //------Embed Content------ //Title function CustomFunction_ShowPage_Title($id) { $post = get_page($id); ...
0
votes
2answers
175 views

Override parent theme function that is not hooked or in the functions.php file

I need to remove a function from the parent theme and replace it within the child theme. The function is called print_meta($meta_box). The function is not pluggable and it located in a random file, ...
2
votes
1answer
49 views

Why do filters/actions require an argument count?

I was just looking at plugin.php trying to answer the above question and I couldn't work it out. The actual code that calls filters is this: do { foreach( (array) current($wp_filter[$tag]) as ...
2
votes
1answer
292 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, ...
1
vote
1answer
82 views

Remove class that has been added by parent theme

My parent theme generates the following class in body: style-cupcake. I don't want that. The best way to get rid of this is by adding my own functions in a functions.php file in my child theme, right? ...
0
votes
1answer
63 views

Function Reference for custom link in Admin Menu Management Page

What is the function reference for the text within the URL field in the Admin Menu page? I have a PHP function that is utilizing the_content function reference to look for specific file paths and ...
0
votes
1answer
158 views

Display a list of users with avatar filterable with alphabets

I'm trying to create a page which should display a list of users with the role "Author" only and exclude all other default and custom roles. I also want them to be filterable by alphabets, so if I ...
1
vote
2answers
699 views

Add class to menu items of one specific menu (nav_menu_css_class)

This code adds an extra class to all my menu items: add_filter('nav_menu_css_class' , 'special_nav_class' , 10 , 2); function special_nav_class($classes, $item){ $classes[] = 'btn'; return ...
0
votes
2answers
145 views

Content filter won't work

I'm trying to filter my content and on matches on flow I would like to change my html structure, but my rule doesn't really apply. I have the following filter which searches the first image of posts ...
0
votes
2answers
504 views

Make wp_link_pages() suitable for Twitter Bootstrap markup

Below there's the Wordpress code found in post-template.php for the wp_link_pages() function - this function generates a page navigation for posts or pages having the content split into multiple ...
1
vote
2answers
351 views

Convert hyphen to underscore in permalinks

I would like to use underscore in my permalinks instead of hyphen. Current permalink: www.example.com/2013/01/hello-this-is-a-test-post/ Desired permalink ...
-1
votes
1answer
51 views

filter just a portion of plugin function

I'm trying to edit just a few pieces of bbpress' breadcrumb default settings, but the filters I've tried end up replacing the whole function. How do you replace only bits? Here is the filter as it ...