How to show WordPress parent and child category using a different template?

I am currently trying to do a directory style site, and I currently have parent categories and child categories. Right now, I have the parent categories showing and when a parent category link is clicked I’m using category.php to show the list of child categories. Now I want to that when a child category link is clicked WordPress shows all the posts in this child category. Is there a conditional statement or a way that I can have the child categories go to the archive.php so it can display something…

Override a theme function in a child theme?

Most if not all of the answers to this question are pretty old, or are for edge cases. I have a child theme for a commercial theme (« Total »). The parent theme’s functions.php loads functions from several php files in its « framework » folder. The function I am targeting is in fonts.php, called wpex_standard_fonts: if ( ! function_exists( ‘wpex_standard_fonts’ ) ) { function wpex_standard_fonts() { return array( « Arial, Helvetica, sans-serif », « Arial Black, Gadget, sans-serif », … ); } } So, from what I have googled, I take this add to my child theme…

Does a parent page’s post_title have to appear in a child page permalink?

If I have a page called Home and then a child page with Home as the parent, is there a way to avoid ‘home’ appearing in the permalink for the child page? I’ve noticed this with a one-page scrolling theme which asks you to set lots of pages as child pages of the homepage. From an SEO perspective, its not great to have ‘home’ in all the permalinks. This question seems relevant but refers to categories Source: https://wordpress.stackexchange.com/feeds

WordPress Shortcode callback function with a plugin

I am working on a plugin and the plugin currently works great on the admin section but I’m trying to extend the functionality to the front end and using a shortcode to use the same functions. I have a form that gets displayed currently with the following code: function display_sheet_form($f=array()) { $count = (isset($f[‘task_title’])) ? count($f[‘task_title’]) : 3; if ($count < 3) $count = 3; echo ‘<form name= »add_sheet » id= »dls-sus-modify-sheet » method= »post » action= » »>’; //some additional code here echo ‘<input type= »hidden » name= »mode » value= »submitted » />’; echo ‘<input type= »submit » name= »Submit » class= »button-primary » value= »‘.esc_attr(‘Save’).' » />’; } This…

How to add css classes to widgets using functions.php?

I need to add a class to the WordPress search widget. How would I go about doing so? I’m calling it from the admin side, as in dragging and dropping it into the sidebar at the widgets page of the admin section. I’m not calling it using get_search_form. I want to do so by using the functions.php file, not jQuery or adding css properties. Source: https://wordpress.stackexchange.com/feeds

How to add custom comment fields but *only on the comment reply form*?

I’ve been searching high and low for this but can’t find anything that explains how to add custom fields to only the reply form. I’ve seen and got working custom fields on the comment form, but when a user clicks reply, I want to have a different set of fields. Better still a different set of fields depending on the reply level. Here’s what I’m trying to do. Suppose you have a site which posts a blog entry that you want people to post reviews and comments as a first…

What are best practices to storing uploads in WordPress?

We’ve been storing all of our images using the default /year/month/day, but I’m thinking there has to be a better way to store things because everytime that I update a image or pdf. I have to reupload it and it gets stored in a new location. We occasionally get in the situation where we update a pdf that was uploaded one month, external users are linking to that one and when we reupload, it’s stored in a new location instead of it being overwritten. So to make sure that people…

Web Design Weekly #167

Headlines How to make a performance budget Daniel Mall noticed lots of people writing and talking about performance budgets lately, but hadn’t seen anyone exhaustively explain how to make one. So he did it himself. Thumbs up Dan! (danielmall.com) The Offline Cookbook The when/where/how of caching and serving content offline-first by Jake Archibald. (jakearchibald.com) The State of JavaScript in 2015 (breck-mckye.com) Sponsor Web Design Weekly and reach over 22,356 Developers Articles Reactive MVC and the Virtual DOM An awesome post by Andre Medeiros. Andre talks about how frameworks come and…

How to remove "admin.php?page=" from wp-admin using .htaccess?

I’m looking to use .htaccess to rewrite admin page URLs. I’d like to change it from: http://example.com/wp-admin/admin.php?page=whatever&id=5&var=10 to http://example.com/wp-admin/whatever?id=5&var=10 Right now I have: RewriteEngine On RewriteRule ^members$ admin.php?page=members& [L,E=CLEAN_CONTACT_URL:1,QSA] RewriteRule ^add-members$ admin.php?page=add-members [L,E=CLEAN_CONTACT_URL:1,QSA] RewriteRule ^delete$ admin.php?page=delete& [L,E=CLEAN_CONTACT_URL:1,QSA] RewriteCond %{QUERY_STRING} ^page=(.*)$ RewriteCond %{ENV:REDIRECT_CLEAN_CONTACT_URL} !1 RewriteRule ^admin.php$ /wp-admin/%1?%2 [R,L] Which changes it to: http://example.com/wp-admin/whatever&id=5&var=10 I don’t mind adding each ‘section’ (e.g. members / add-member / delete) to my .htaccess. Although, if there is a better way, I’d be happy to see it! I’m using internal and external redirections, so that when you…

Creating post custom field text area

I want to make, I guess a custom field for my theme. I’m not sure is it the right way to do this with custom fields. I searched a lot, but could not find what I need. So I’m hoping that some one could give some pointers or links, since I dont know what exactly to search for my case. What I want to make is to add below post title bolded intro for the post. I know I could do this by the post, but I am making a…