Articles of theme development

Avoid theme updates, just one theme

I stupidly created a ton of websites with custom themes (not child themes, 100% custom) and named my theme folder “custom”. Now they are starting to auto-update and get replaced with some theme from the repository that happens to use the same folder name. I could disable the updates in wp_config, but I don’t really […]

Where can I access my custom page template?

I understand that to create a new page template, all I have to do is create my custom template (in this case, page-custom.php) file, and save it in wp-content/themes/mytheme/. However, where can I access this newly created template file? I want to edit it now… but it does not show up the page editor’s Page […]

Is there a way to add a class to non current menu item?

When using the wp_nav_menu function, the current menu item markup usually is like so: <li id=”menu-item-19″ class=”menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-8 current_page_item menu-item-19″> <a href=”http://domain.com/page-name/”>Page Name</a> </li> I’m wondering if there’s a way to add a class to the non current item on the menu when there’s an item selected. Something like non-current-menu-item. It […]

WordPress logo upload option in theme panel

Hello every one i am facing one issue in adding logo option in my theme panel of wordpress i am using this code function logo_display() { ?> <input type=”file” name=”logo” /> <?php echo get_option(‘logo’); ?> <?php } function handle_logo_upload() { if(!empty($_FILES[“demo-file”][“tmp_name”])) { $urls = wp_handle_upload($_FILES[“logo”], array(‘test_form’ => FALSE)); $temp = $urls[“url”]; return $temp; } return […]

How the WordPress sidebar works

Ok, the title is surely not good to explain my very basic question, but here it is: I just started creating a wordpress theme and the index.php has two columns: 1.) The main content and 2.) A vertical column where I am showing other info like Archives, Recent posts all programatically. Updated Until now everything […]

WordPress security issue to output data from user input from theme option form

I have the following code (below) in my theme. I am using redux framework for my theme options. My codes in a part looking like this. And I am really not sure about the security issue of this chunk of codes. Please any expert help me indicating any security problem in here. Your few minutes […]

Add theme templates for child categories into the template hierarchy

in my site i have many category and subcategory (child category) say like my one category name Printing – 4 color – 2 color – offset print Exmple i want when visit 4 color category page it will show all 4 color category post with particular template. i tried many code but not is actually […]

Prevent theme from activating

This question already has an answer here: Is it possible to stop a theme activation when a certain plugin is not activated 4 answers

Differences when using the the_time and the_date functions

I have some doubts about how work the WordPress the_date() functions definied into general-template.php In a page I show the posts archive using this code snippet into a loop: <article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>> <header> <h3 class=”entry-title”> <a href=”<?php the_permalink(); ?>” title=”<?php printf(__(‘Permalink to %s’, ‘your-theme’), the_title_attribute(‘echo=0’)); ?>” rel=”bookmark”><?php the_date(“d/m/Y”); echo ” – […]

Creating Page Based on Category

I’m using WordPress 4.0, and the Hemingway theme. I’ve created a custom page template which currently pull blog posts based on the category I give it. However I’m currently using query_posts(‘category_name=food&posts_per_page=-1’); to pull and show all post with the category name food, which means if I create a new page called Ingredients, I would have […]