Articles of theme development

Network: retrieve a list of latest posts

I need to list all the latest x posts from the whole Network in my WordPress Network. I am already using the Sitewide Tags plugin to collect all posts in a separate blog, but I also need to list the latest posts elsewhere. Most scripts and plugins I have been looking at only list one […]

How to remove a file included in parent theme with locate_template() via child theme?

In my theme I use locate_template() to load the various parts of my functions library. I’m looking for a way to not include one of those files when using a child theme. I tried adding locate_template(‘same_file_name.php’, false); to my child theme’s functions.php but it is still included. CLARIFICATION EDIT: I don’t want to prevent this […]

How to make WP admin recognize a newly created child theme?

I am having a problem that’s very similar to the one described here, except that the solution that worked for him (text encoding) didn’t work for me. I even tried applying unix2dos -o style.css from the command line (which definitely changed the file from LF to CRLF, as I could see that the file increased […]

Theme Check: Could not find post_class

I’ve inherited a theme from a another developer that I’ve re-styled for a client. We’re just about finished, but I thought I’d run it through the Theme-Check plug-in to see if there’s any errors or problems. Unfortunately there’s a ton. I’ve gotten rid of most of them, but I have one Required left: REQUIRED: Could […]

How do you remove plugin edit option?

I would like to remove the edit option for all plugins on a wordpress site. Is there a hook/filter for doing this? It would be preferred to do it from the theme’s functions file, rather than try to disable it within each plugin. Ideally, it could be removed for users without admin privileges, but that […]

Unhook jQuery from WooCommerce via `functions.php`?

So I am using the http://woothemes.com/woocommerce/ plugin for eCommerce and it’s registering jQuery local and conflicting with my default jQuery call from Google CDN. It took a long time but I isolated the issue to the following lines of code within woocommerce.php: $suffix = defined(‘SCRIPT_DEBUG’) && SCRIPT_DEBUG ? ” : ‘.min’; $lightbox_en = (get_option(‘woocommerce_enable_lightbox’)==’yes’) ? […]

Remove css styles from specific page

I need to remove all theme (both child and parent) css styles from a singular page using functions.php in a child theme. Here’s what I’m currently adding to the child’s functions.php // import parent and child theme css function theme_enqueue_styles() { wp_enqueue_style(‘parent-style’, get_template_directory_uri() . ‘/style.css’); wp_enqueue_style(‘child-style’, get_stylesheet_directory_uri() . ‘/style.css’, array($parent_style));} // remove the parent & […]

How to integrate plugin in WordPress theme

I have read that there are two ways for integrating a plugin on a WordPress theme. I think the first method is the best; but I do not know exactly how to do it… After copying the plugin to the plugin directory of WordPress… How do I enable it? Do you know another way to […]

Custom Template for more than 1 Tag

WordPress let me create custom tag templates, i have lots of tags, and i want to display the post tagged with some tags with a template, and the post tagged with other tags with another template. As this image shows the template hierarchy let me create the tag template easily, giving to the page the […]

Unhook action from child theme

I have decided to use a WooCommerce Storefront child theme called Galleria, when I have previously used the Storefront theme I have used the common remove_action to unhook the defaults and replaced with my own add_action. However as Galleria is a child theme of Storefront, it has its own add_action in the file class-galleria-structure.php though […]