Tagged Questions
0
votes
1answer
61 views
How to edit php code in WordPress Post file?
I have a wordpress page. In that wordpress page, user will have access to the following Window to Publish their Post in to the webpage.
If the user enters an URL in any of the three filed I have ...
-1
votes
0answers
39 views
Is it possible to dynamically add widget areas?
I am creating a very custom and unique theme that uses posts as sections for the front page. The posts all have a configured style to them, so I am wondering if it is possible to dynamically create ...
1
vote
1answer
26 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
0answers
55 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 ...
2
votes
1answer
76 views
Hide custom image sizes from media library
I want to hide a few custom image sizes from the media uploader:
The following code (posted here) works only for the default image sizes:
function remove_image_sizes($sizes) {
...
0
votes
1answer
58 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 ...
0
votes
0answers
63 views
How to build a search filter?
Can annybody tell me how can i build a search filter.. were do i start.
I want to filter the categories for 3 post type's
Ex:
I have Movies(posts) with categories
Year: 2011,2012,2013
Gene: ...
0
votes
2answers
44 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
323 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 ...
3
votes
1answer
361 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, ...
11
votes
2answers
549 views
How to make a image-size selected by default in Media upload - WP v3.5
Bare with me. I want to have a custom image size selected by default in the Media upload popup page. In Wordpress v3.4.2 and prior, this elegant code worked fine:
function ...
6
votes
1answer
793 views
Set media upload attachment link to none and hide it in WP v3.5
In the Media upload popup page, how do I set the attachment link to none and hide it in Wordpress version 3.5? The following filter worked fine in earlier versions of WP:
function ...
5
votes
2answers
786 views
Remove “Insert from URL” link in Media upload - WP 3.5
How do I remove the Insert from URL link in the new Wordpress 3.5 Add Media popup page? In earlier versions of Wordpress, this worked fine:
// removes URL tab in image upload for post
function ...
1
vote
1answer
202 views
Rewriting search and pagination base
After trying for weeks now how to find a working solution I got rid of most of my functions and trials and just left the pagination function underneath in my functions.phh file:
/**
* Pagination ...
0
votes
1answer
111 views
How do I filter a custom post type loop by a field?
OK, very simple task, I'm just not good at PHP.
I have a page where I want to list some staff using a styled list. Here is the page all working fine, I just need to divide the results - ...
0
votes
1answer
38 views
WXR XML import is stripping php tags that I need to keep
When I import my WXR XML file it appears that wp_insert_post (or another function) is applying filters to strip php tags that I need to keep in my content.
I have searched the various wp-include php ...
2
votes
4answers
193 views
Filter link to existing content suggestion
How can i filter the link given in "link to existing content".
Eg:
As in the above image. I just want WSP BANNER TO BE SHOWN.
where WSP BANNER & CALENDAR are custom POST types
Any help will ...
0
votes
1answer
89 views
Change page title from page using php via php executed from page/post itself
I am running a plugin from a WP page to execute PHP and it works great. I'd like to edit the page title and description based on POST data. I am already using POST data in the PHP code to alter the ...
0
votes
1answer
52 views
Wordpress doesn't load HTML
All,
I'm trying to have a side navigation menu that once you click on a link it basically pulls the content of that wordpress page and displays it. I've got the following code to do this:
$qry = ...
0
votes
2answers
147 views
How to make modifications only to certain elements of an HTML string on the server-side?
Is there a similar way to select / perform DOM manipulation on the server-side (PHP) like the way jQuery works?
For example, if I wanted to modify content of each <pre ...
1
vote
1answer
232 views
How do I alter the comment form 'allowed tags' text in a plugin?
I'm using the PHP Markdown plugin, and I'd like to modify it so that it adds some text to the bottom of the comment form indicating that Markdown is supported in comments.
I've been modifying my ...
0
votes
1answer
77 views
While there is content; applying filters in blocks [closed]
So I'm trying to filter content and get it into 1400 character blocks (or there abouts, using </p> as separation points.
I can do this. My question is (hopefully) a simple PHP one (I am still ...
1
vote
1answer
151 views
Change comments form title on a page by page basis
I'm looking to change the comments form title (my theme defaults this to "Leave a Comment" or "Leave a reply to").
I thought perhaps I could add a hook to comment_form_defaults but my snippet below ...
0
votes
2answers
125 views
Alter required message using comment form api
I prefer not to use asterisk markers on required fields in the comment form.
So I'd like to remove or alter the 'required fields are marked (*)' message.
Being a good wordpress user, I'd like to do ...
1
vote
1answer
236 views
Taxonomy filter all children
I have a custom taxonomy filter that will filter all the pages in the selected taxonomy. I would like the code to select the pages in that taxonomy, and the children of thous pages.
Heres the code.
...
0
votes
2answers
155 views
How to internationalize header image?
I have in the following code in the template:
<img src="<?php header_image(); ?>" />
However, I want to change this image according to the language selected (through GET parameter ...
2
votes
1answer
435 views
Apply class to every paragraph that holds image?
Hey guys,
When adding an image to a page or post wordpress is automatically adding a paragraph tag as parent holding the image.
since there is no parent selector in CSS I'd love to find a solution ...
1
vote
1answer
1k views
adding a filter to a shortcode?
<?php echo do_shortcode('[mingleforum]'); ?>
inserts the mingle forum into my content!
is it possible to use add_filter() on that?
1
vote
3answers
3k views
add_filter to post-gallery and remove all <br>'s?
hey guys,
i really need your help.
Whenever I use a gallery in wordpress and set it's columns to just 1 Wordpress automatically adds <br style="clear: both"/> after every <dl ...
0
votes
2answers
345 views
Check if variable is set in filter
Thanks to your suggestions, I enabled wp_debug and discovered flaws with my plugin. I have a filter for sorting posts by votes. I use it when the sort URL parameter is on.
add_filter( 'posts_where', ...
1
vote
1answer
613 views
add_query_arg not working
I added a filter to append a parameter onto the URL when navigating in categories. This is used to sort posts by their votes when browsing a category only if a sort parameter is set.
For instance ...
2
votes
3answers
3k views
How to set custom cookies before output
What's a surefire way to check/set cookies before the php headers are sent? Is there an action or filter that would be the best place to hook a setcookie() function?
