193 reputation
322
bio website
location Belgium
age 23
visits member for 2 years, 10 months
seen Mar 11 at 19:41

Twitter Twitter @BramVanroy


Web design and web developing hobbyist. Especially enthusiastic about CSS(3), HTML(5) and jQuery. I do my best to help where I can.

I'm also interested in a couple of other things, such as


Mar
10
comment Stop Wordpress Wrapping Images In A “P” Tag
Note that this won't work with HTML5 default img markup, i.e. <img ...> without the closing slash. It's better to make that optional in your regex. Or better yet, you can leave it out as .* will take care of it.
Mar
2
comment Metabox of one post influence setting on other
If you want you can always check it out here.
Mar
2
comment Metabox of one post influence setting on other
Ah yes, something I should've been able to figure out by myself. Thanks for the tips as well! 1 was caused because I quickly translated my actual file which is in Dutch, I must have overlooked to escape the characters here. Thanks for number 2. I had seen those fields starting with _ in plugins but I never knew what they were. 3: a coincidence that you should mention it. I posted a topic on CodeReview this morning for just that: making the code more compact.
Mar
2
comment Add field to posts (checkbox) that only one post can have
Hi there David, after adding some functionality I have run into some problems with saving the posts. Could you take a look if you have some time? Thanks. wordpress.stackexchange.com/questions/179918/…
Feb
27
comment How can I fetch loop of post titles via AJAX?
I know that this is an old answer, but it's still relevant to me. I do wonder why the return false is necessary, as you are calling it on the click event of a button, to which there's no form related. I think you could leave it out. Also, how does check_ajax_referer know what to check, as you are not using any nonce fields? And what is wp-ajax-response?
Feb
18
comment Add field to posts (checkbox) that only one post can have
Ah yes, setting to -1 works as well. If you could change that in your post?
Feb
18
comment Add field to posts (checkbox) that only one post can have
David, I see what you mean but unfortunately that doesn't work either. Maybe WP considers 0 as an impossible value and returns to default behaviour, i.e. a "parameterless loop". I found and tested a work-around though, by checking the option. Please see my edit in my OP. I am no hero in PHP, so maybe you can find a way to make it more efficient. If the code seems fine to you, however, it might be better to add that snippet to your post so that other people will find the working code in your post.
Feb
14
comment Understanding and using metaboxes in posts
Thank you for your answer. I'm not entirely sure what the field_name is supposed to stand for though. Considering my OP, I tried source_post for input_name as well as field_name. Also I'm not entirely sure what the to read snippet is for, as you apparently don't use it for echoing the data. Is it necessary to show the user what he/she has submitted? Where should it be placed in my functions?
Feb
14
comment Add field to posts (checkbox) that only one post can have
David, after some testing I have run into a problem that I cannot explain. Please see my edit.
Feb
11
comment Display category title and three latest post inside the category
Ah, I see. Haha, darn it. Figured it out moments after I posted that comment and didn't want to come on as stupid or lazy, so I edited that part out. Too late I guess. Thanks again, works great!
Feb
11
comment Display category title and three latest post inside the category
After fiddling around I got it to work! Question though, why is wp_reset_postdata(); inside the foreach loop? Or, more precisely, does it matter whether it is inside foreach or out?
Feb
11
comment Add field to posts (checkbox) that only one post can have
I suppose it is. Thanks again!
Feb
11
comment Add field to posts (checkbox) that only one post can have
And a heads-up: I got a PHP exception error because the second line of your query 'p' => get_option('my_sticky_post'); contains a trailing semicolon.
Feb
11
comment Add field to posts (checkbox) that only one post can have
As I'm relatively new to PHP I must ask, why is while necessary as we know there can only possibly be one sticky post?
Feb
11
comment Add field to posts (checkbox) that only one post can have
Wow David! This is great!Am I right in presuming that the best way to use this in a template, is to use an if-clause after setting the new WP_Query like so?: if ($stickyPost->have_posts() ) : $stickyPost->the_post();, then do all my HTML outputting, and then conclude with closing the if-clause and resetting the query? wp_reset_postdata();?
Feb
11
comment Display category title and three latest post inside the category
@PieterGoosen Now calm down y'all, we've got a question to solve here. :D
Feb
11
comment Display category title and three latest post inside the category
@DavidGard This snippet will eventually be output inside single.php. Thanks for the tip!
Feb
11
comment Best way to allow for extended use of Wordpress functions inside single.php
I guess I am confusing the whole-scale WP_query with the while loop.
Feb
11
comment Best way to allow for extended use of Wordpress functions inside single.php
D'oh! Silly me. Thought the loop was the part where while runs. I've got a lot to learn. is_singleisn't necessary I think because all of this goes into single.php.
Feb
9
comment Apply class to every paragraph that holds image?
@MarkKaplun I+ can assign the bounty, not a problem. Also I think that a lot of people looking to get bounties look at bthe bounty category, so they'll find their way here.