Posted by Prem Tiwari | Updated on | WordPress
I copy pasted your code into my dev environment, changed nothing but the page name, and it works just fine. Are you sure that it’s not being enqueued and you just have it pointed wrong …
Posted by Prem Tiwari | Updated on | WordPress
current_shortcode() detect currently used shortcode. I made my catch all handler accept a third argument, which is the shortcode name:
Posted by Prem Tiwari | Updated on | WordPress
That’s a nice option, but I agree with sri, right now it really depends on your theme. You can do a work-around through is_page(). You need to write something like this on your page.php theme …
Posted by Prem Tiwari | Updated on | WordPress
At the beginning of wp_insert_post, the function that saves/updates a post, there is a filter called wp_insert_post_empty_content. By default this filter checks whether the title, editor, and excerpt fields are all empty, in which case the save …
Posted by Prem Tiwari | Updated on | WordPress
I am not sure if this will work for you but it is worth a shot. I use this all the time for my custom post types when they require a special template.
Posted by Prem Tiwari | Updated on | WordPress
If still relevant, maybe this could help others looking for similar solutions
Posted by Prem Tiwari | Updated on | WordPress
You should be familiar with already, as you should be using it to create the table. On your install hook you should have something like:
Posted by Prem Tiwari | Updated on | WordPress
This is an example of a dynamic widget that renders two fields (image-id and url). if you enter an image-id and press “update”, two new fields are added. I build it to create a slick …
Posted by Prem Tiwari | Updated on | WordPress
If you want to test your custom SQL to see how it affects the loading time, you can try this query swapping:
Posted by Prem Tiwari | Updated on | WordPress
Using a class for encapsulation is a very common approach by a number of developers for plugins. I do this, and I do find it cleaner. But for plugins. Themes are more procedural by nature. …
Posted by Prem Tiwari | Updated on | WordPress
How can you set maximum width for original images. I was able to solve it using the following code:
Posted by Prem Tiwari | Updated on | WordPress
There is not ethical way of doing this. But still there is a way to do this. WordPress wrote wpLink script keeping in mind that editor is there but still WordPress handle when editor is …
Posted by Prem Tiwari | Updated on | WordPress
Symbolic Links on dev box with plugins and stylesheets. As you can see, the plugin URL is correct except for the real path stuck in the middle. We can filter the function responsible for generating …
Posted by Prem Tiwari | Updated on | WordPress
The redirect_canonical function in /wp-includes/canonical.php is called on any given URL and will attempt to best-guess the URL the user wanted, and redirect them to there, when a URL does not exist. It has a …
Posted by Prem Tiwari | Updated on | WordPress
Is there a is_user_logged_in() for multisite? The way users work in a multisite scenario is that there is a single pool of users, who are then associated with blogs. So, logged in status is common …