A type of hook that provides a way for content to be overridden programatically
0
votes
2answers
35 views
How to combine multiple body classes
My theme already has a specific body class filter for the colorscheme it uses. How can I also add a body class filter for the page name? Basically I want to combine these statements:
<body ...
0
votes
2answers
63 views
How to use the 'comments_number' filter?
I'm not sure how to use this filter. Could someone show me an example? I'm trying to change ('0', '1', '%') to ('0 Comments', '1 Comment', '% Comments').
I'm using this function to get the comments ...
0
votes
1answer
23 views
Usage of filters
Why is the filter removed after fetching feeds in the following example (from WordPress.org?)
<?php
function return_7200( $seconds )
{
// change the default feed cache recreation period to 2 ...
0
votes
1answer
23 views
Identify admin/logout and more filters
I have several links I need to apply filters to them. Having hard time understanding from the documentation which are the correct filters I need to use.
I am not using the default theme.
This links ...
0
votes
2answers
59 views
Action hook to control access to certain parts of my site
I'm searching for an action hook which I can use to control access to certain parts of my Wordpress site. I want to write some custom PHP which will check certain user attributes and decide if they ...
1
vote
0answers
56 views
wp_mail works with add_action('save_post', …) but not an ajax action
I have two actions. One is after saving a post, so add_action('save_post', 'on_any_post');
I have a second action triggered via AJAX, so
add_action( 'wp_ajax_nopriv_saveTaskPriority', ...
0
votes
1answer
137 views
Image size filtering in Media uploader according to custom post type
I have three different custom post types which require an image upload in the admin post edit page.
Each type has its own image size setting. Let's say:
'news' type => picture size required: ...
0
votes
1answer
68 views
Add Default Wordpress Formatting To Data From External SQL Tables?
I have a number of external SQL tables that have data in exactly the way I want and I would like to use them to populate various wordpress posts with shortcodes.
The problem is that I don't ...
0
votes
1answer
36 views
page wordpress add extra unwanted stuff
i want to add this part to wordpress page but every time i add it wordpress add extra stuff that stop it from working properly this is my code
<li data-hovercolor="#e859c5">
...
0
votes
2answers
30 views
Why this filter hook is not working when passing parameters?
Supposing I have this function which I hooked into my_get_users function:
function define_users($group) {
//Query database for users belonging to a group
global $wpdb;
$users= ...
1
vote
1answer
98 views
How to use shortcode attribute in separate function
I'm working on a WordPress site and have installed a slider plugin that registers a slider on the backend (or multiple sliders) and then displays it on the front end with a couple of simple php ...
0
votes
1answer
32 views
Footnotes in custom fields
I am using Jquery Hover Footnotes plugin that allows adding footnotes and dynamically displays them on hover-over.
In other words, I use {{FOOTNOTE_NUMBER}}, Then I embrace the actual footnote text ...
0
votes
1answer
162 views
Add a Span Around a Product Title in WooCommerce
I'm customizing a custom theme to use WooCommerce. One of the issues I've run into is adding a span tag around a product title on the single product page. I've figured out how to add a filter to the ...
0
votes
1answer
135 views
Filter/Remove HTML Elements on all posts and pages
I'm working on a migration from Drupal to WP. The database conversion and import went smoothly, but there is a lot of 'crap' in each post content such as divs with inline styles. Basically, in each ...
0
votes
1answer
89 views
get_the_excerpt() with fallback like the_excerpt()
You know when using the_excerpt() and no "excerpt" is set on a post it automatically uses the first 50 words or so.
Is the same also possible when using get_the_excerpt()
For instance I'm using ...
0
votes
1answer
34 views
How to get current action?
I am developing custom registration form. Is it possible to get current action (comment adding or user registration) in function? For example i am using:
add_filter('preprocess_comment', ...
2
votes
0answers
81 views
Buddypress: Edit activity when new blog post
I am trying to edit the activity on Buddypress (1.7 and running latest Wordpress) for when a new blog post is created. By default it displays the excerpt and shows any attached images, it also strips ...
1
vote
2answers
65 views
Query reset problem or flawed code to enable custom post type query
After reading through here and trying various options, I am finally able to get my custom post types 'testimonial' (created with product 'Toolset') to show along with my standard cat/tag queries ...
0
votes
2answers
45 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 ...
2
votes
1answer
53 views
How do I set the link in the Custom Post Type admin menu?
I'm trying to create a custom button and link it to a file within the plugin. How do I get this link pointing to the path of my choice?
I've tried the following but it does now work.
function ...
1
vote
0answers
203 views
Refine/Filter the Search Results by Category
I am currently creating the process of a function which allows one to refine results, Namely by category. Similar to themeforest.net refine the search results.
When i gave as search term "Hello" and ...
0
votes
1answer
184 views
remove other tabs in new wordpress media gallery
I recently updated my WordPress site into the latest WordPress version, and i added a code to my functions.php that would add a capability to subscriber to upload using WordPress media upload. I ...
0
votes
1answer
53 views
modifying the comment form
I see that there are lots of filters and things you can do to remove fields or modify them. I have found some useful ones on this site. I want to take it a step further because I want to do some ...
1
vote
1answer
92 views
Get Posts updated or published within the last x hours
Okay, I'm trying to get posts that have been published within the last x amount of time, options being 8, 24 or 72 hours. I have the variables being passed to my featureHandler.php via ajax, then ...
1
vote
0answers
67 views
Admin search post meta
I have currently built a property database using WordPress and am purely using the back-end for the whole job. I am listing all the properties and used a plugin called "Easy Filter" to add custom ...
1
vote
1answer
140 views
How to filter posts that belong to a specific category only if that is the only category
I need to filter posts that belong to a category only if that is the only category. For example if my post A belongs to cat1 and I don't want to display posts that belong to cat1, post A won't be ...
0
votes
1answer
473 views
Filter results with custom field values and dropdown
I need to filter posts by a custom field value.
My specific example:
User browse to products > category 1 > subcategory A.
ALL "subcategory A" items (products custom post type) are displayed
as ...
2
votes
1answer
36 views
Hook to edit an column on comments screen?
At the moment I'm doing
add_filter("manage_edit-comments_columns", function($columns) {
unset($columns["author"]);
$columns_one = array_slice($columns,0,1);
$columns_two = ...
0
votes
1answer
31 views
Parse a shortcode differently based on on what it's nested in
Suppose we have two different sets of nested shortcodes, like this:
Apple version
[wrapper snack="apple"] Today I had a [flavor] snack... [/wrapper]
Desired output: My snack was quite HEALTHY ...
0
votes
1answer
61 views
Is it possible to remove next-post / previous-post with out creating a custom template?
I'm creating a plugin that uses a custom post type. I do not want to make a custom template for viewing the posts and discovered I can add a filter for the_content to include my custom fields, this ...
0
votes
1answer
177 views
Admin post list - adding an option to the date filter dropdown
I've been asked if I can add an option for "Today" and "Yesterday" to the date filter dropdown at the top of the post list in the WordPress admin view. (This is the list that shows recent ...
0
votes
3answers
64 views
Need to return shortcode text instead of the output
Is there a way I can return the shortcode text instead of the output.
My code function is hooked into 'the_content' and I know if my function contain shortcode it will automatically generate the ...
0
votes
1answer
40 views
Sanitizing a custom query's clauses
I'm trying to build a custom query much like the one found in WordPress' native get_posts() inside wp-includes/query.php, meaning something along these lines:
global $wpdb
SELECT *
FROM ...
1
vote
1answer
47 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
2answers
333 views
remove_filter( 'the_content', 'wpautop' ); only for certain post types
I want to try and remove automatic p tag and br tag addition for my custom post type.
It looks like
remove_filter( 'the_content', 'wpautop' );
will do this, but how would I make the change only ...
0
votes
1answer
24 views
Adding a filter to related posts not working
I'm using the the filter below to filter related posts by author, I added an author ID to test but they are not filtering by author
add_filter( 'woocommerce_product_related_posts', ...
5
votes
1answer
66 views
Add whitespace between Chinese and other letters
I want to add a space between a Chinese character and a letter or a number to make the article more readable.
For example:
Google与Apple展开的专利大战在2天之前结束。
Google 与 Apple 展开的专利大战在 2 天之前结束。
But ...
2
votes
1answer
85 views
How to remove the Theme Customization Button from the dashboard and themes options page?
In my Wordpress theme that I've currently been building I do not take advantage of the Wordpress Theme Customization API. As much as I would like too, I've invested far too much time into my own ...
2
votes
1answer
90 views
Gallery Settings Change available Columns
Is there a filter hook which changes the number of available columns in gallery settings screen. I'm talking about the :
<label class="setting">
<span><?php _e('Columns'); ...
0
votes
1answer
126 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 ...
2
votes
1answer
332 views
Rename image uploads with width in filename
I am attempting to change the name format that Wordpress uses to rename uploaded files. For example, when I upload an image with filename "cat-picture.jpg" Wordpress will create scaled versions and ...
0
votes
1answer
42 views
How to display childrens custom fields?
I need help, I have a page that I want to display content from the page children, I get the content but not the custom fields!
I've tried this but it dosnt work, what am I doing wrong?
<?php
...
1
vote
1answer
65 views
How to order posts of a custom post type by date DESC in dashboard Admin?
I created a new post type named "Video".
When I create post for the post type, posts is ordered by title ASC.
Is it possible to order posts by date DESC please ?
register_post_type('Videos', ...
0
votes
1answer
81 views
Custom priority with the_content filter based on user input
Currently, in my plugin Contextual Related Posts, I have an option to automatically add the related posts to the content using
add_filter('the_content,'ald_crp')
I know I can change the priority ...
0
votes
2answers
87 views
Can I the caption shortcode to set caption to a data attribute, and with the image's alignment intact?
I want to output an image caption in this kind of format:
<img class="alignleft size-medium wp-image-316" alt="Image Title" data-caption="Here lies the image caption" ...
3
votes
1answer
385 views
Change html structure of all img tags in Wordpress
I have a Wordpress blog and am trying to implement the foresight.js image script. In short, I need to target all post images, swap out the src, width, & height attributes with data-src, ...
0
votes
2answers
28 views
How to display the content HTML of a page without displaying the gallery code as well
I am using the below to fetch the content of a page by its name and output the html
$my_wp_query = new WP_Query();
$page = $my_wp_query->query(
array(
'post_type' => 'page',
...
0
votes
1answer
160 views
Where is the best place to use add_filter
Should I use the function add_filter In my plugin's init action hook or just the in the main plugin script?
Since sometimes I found people is using filter all over the place and if I put in the init ...
0
votes
1answer
80 views
Why does apply_filters behave different inside and outside a loop?
What I want: the array of posts returned by creating $query = new WP_Query($args);
Why: to return specific content as a sort of API request in json format, ready to display on another site
What I ...
0
votes
2answers
184 views
Remove custom taxonomy column from my custom post type columns
I am using wp 3.5 i have a custom post (sp_product) and also i have custom taxonomy. I want to remove that custom taxonomy filter column but i don't want to make 'show_admin_column' => false.
I ...