Articles of theme development

Child Theme not loading parent CSS

I’m using the MyStile theme for a new site. I’m trying to create a child theme so I can modify the theme and not have my changes overwritten, however once I activate my child theme, the whole styling seems to go from the website all together. I’m guessing the issue here lies somewhere when it’s […]

WP_Query arguments to fetch custom post type posts which are in certain category?

I’ve played around for hours but still can’t wrap my head around the right arguments for a secondary WP_Query which shall fetch all posts of my_custom_post_type that are in the queried category. Scenario is a custom category.php template file (writing a custom theme) to render a category archive for custom post type posts. Hence, the […]

Correctly using wp_head()

I’m working on my first theme, and I found out that I had to call wp_header() before </head>. My header.php file has this: <!DOCTYPE html> <html> <head> <title><?php bloginfo(‘name’); ?> | <?php the_title(); ?></title> <meta content=’text/html;charset=utf-8′ http-equiv=’Content-Type’> <meta content=’utf-8′ http-equiv=’encoding’> <meta name=’viewport’ content=’width=device-width’> <link rel=’stylesheet’ type=’text/css’ href='<?php bloginfo(‘stylesheet_url’); ?>’> <link rel=’stylesheet’ type=’text/css’ href='<?php bloginfo(‘template_directory’); ?>/side-nav.css’> […]

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=””>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 […]