422 reputation
310
bio website derk-jan.karrenbeld.info
location Delft, The Netherlands
age 23
visits member for 3 years
seen Jul 9 at 6:00

Still a random idiot

He is, including, but not limited to, a dancer, does competitions in sailing and ballroom- and latin dancing, designs yearbooks, writes for the faculty magazine about computer science and mathematics, writes about local events, voluntary work and other youth talent in the local newspaper, and about lymphoma (cancer) and other inspiration on his blog. Any free time is filled with friends, family, learning himself to play piano and game-development.

Enjoys every moment of life.


Jan
16
comment Rewriting a page driven by custom fields to populate a page dynamically, like posts
Do you mean you are not showing posts, just data from custom fields? Presumably in an array? You can unshift data to that array, so it will be inserted on the front. Or are you using a custom field to order the custom posts that are being displayed.
Jan
16
comment Combining custom post type and post category
I said it's currently not possible to combine the OR statement in a single WP_Query fetch. The problem is solvable. Both my and Toms solutions should do the trick.
Jan
16
comment Combining custom post type and post category
@kallekillen try the current code.
Jan
16
comment Performance concerns: index.php vs taxonomy-$taxonomy.php
You are very welcome! The reason is that you effectively cut two queries per page load (the ones you were overwriting). I suggest looking at slideshare.net/andrewnacin/… if you want to understand why it became so much faster.
Jan
16
comment Combining custom post type and post category
If you want to display ONLY video category posts that are of the custom post type video, use the query on the top of my answer instead of the two provided in the solution.
Jan
16
comment Combining custom post type and post category
It should display BOTH the video post type posts as well as any post with the video category. That is what you wanted, right? And no, they are not combinable in one query if that is what you're asking for.
Jan
16
comment How can i simulate “taxonomy__in” in query?
Edited the code accordingly.
Jan
16
comment Combining custom post type and post category
Thanks @TomJNowell! Just caught it when you posted that :)
Jan
16
comment Combining custom post type and post category
I actually did not test it - just wrote it here, maybe I made a typo, but a white page usually means an error. Let me try it.
Jan
16
comment Combining custom post type and post category
I edited both your question to reflect the comments you just made and my response should provide with what you need. See the Either this or That section. That said, really look at the link @TomJNowell posted. It is vital when creating queries. Also take a look at the link in my post to WP_Query to see what options are available.
Jan
16
comment How can i simulate “taxonomy__in” in query?
@Marius Ah. Do you want to list all the cities? Or all the posts in all the cities?
Jan
16
comment Performance concerns: index.php vs taxonomy-$taxonomy.php
@DanielSachs Haha, but if all the archive layouts are the same or have to be in the same place, at least try to get up the tree with archive.php. Nevertheless, you could always implement get_template_part( 'content', 'some-archive' ) or something similar. Yes, a lot of people don't know about it, but it's kinda vital. As a rule: if there is a $variable (not $_variable) there is [almost always] a hook of filter. That's in the coding guidelines of the WP Core ;) (Almost always: en.wikipedia.org/wiki/Almost_surely)
Jan
16
comment Redirect Old .php URLs to New Wordpress Page
@AndrewM I added a solution which actually puts in the URL for you :)
Jan
16
comment Is it ever okay to include inline CSS in plugins?
@Dustin if it absolutely needs it to function, you should still allow the user to break the Plugin. Just make sure you enqueue it in the first place. If the user knows how to dequeue a style, lets assume that he also knows he is breaking the plugin by doing so. But that's a leap of faith I think we should all take.
Jan
16
comment Is it ever okay to include inline CSS in plugins?
@MarkKaplun, you are correct. I usually write this post about both CSS and JS. Let me edit that.
Jan
16
comment Is it ever okay to include inline CSS in plugins?
You can't, but the user of the plugin can. There are several plugins and functions written to, just before the page is outputted, get ALL the enqueued styles and add them to a minified, combined file. No matter how many CSS files you add, the viewer will only see one. Same for javascript. However, this is in your case not your 'problem'. It's optimization that is not needed and imho, the extra HTTP request kinda falls short against all the PRO's.
Jan
16
comment Is it ever okay to include inline CSS in plugins?
@bungeshea If someone is going to change your plugin, they might want to change the backend too right ;) Just make sure you only enqueue the script when on the backend. For example: function _your_enqueue( $hook ) can test $hook to see if your on your options page. Alternatively you can use current_screen() for simpler properties. The thing is, you ARE allowed to do this, but the general use is a plugin consists of a .php file for serverside code and may or may not have images, .js and .css files.
Jan
16
comment Restrict url to one segment, even when page or post is nested
A solution per plugin is given here: wordpress.stackexchange.com/questions/56380/…
Jan
16
comment Difference between Option_Group and Option_Name in Register_Settings
Yes, yes and yes. That's the reason why tutorials use the SAME identifier for name as for group. The thing is, you don't NEED to. You may always register multiple name for a single group. Can be convenient if you have optional modules with separate save code. Saving might overwrite options already there. So you register a new option. But displaying them should happen at the same options page, so you tie it to the same group and voila.