Articles of themes

Is It wrong to use oop approach on functions.php?

I’m building a theme, and I’m using an oop approach, nevertheless all themes source code that I have seen until now, make use of procedural approach, so they write this sort of code: If ( ! function_exists( ‘my_theme_function’ ) ) { my_theme_function() { // code function here } } So what is the ideal methodology […]

Change Default Image HTML

I am making a WordPress theme and want to change the default image html. For example if you upload an image using WordPress uploader it generates the following html for your images <a href=”image_url_goes_here”> <img class=”aligncenter size-full wp-image-100″ src=”your_src”/> </a> I want to change it to something like this <div class=”image-container”> <img class=”aligncenter size-full wp-image-100″ […]

How to change the contact info at the bottom of my theme

Im currently using the Spina theme for my website and at the bottom of the page above the footer it has a section with the headings “contact us”, “receent posts”(It’s actually misspelled like that), “meta”, and “tags”. The contact us section displays info that I have never entered. Like for the email it lists […]

Customizing wordpress to match your site theme

I have been wondering about how I could customize a WordPress theme to look like that of my site, which is basically made of simple html and css. Alternatively, do you think there is a customizable simpler blogging solution that can be used for the same purpose?

How to change sidebar per page?

I am new to theming with wordpress. I have a theme layout with one sidebar at the right side of the website. Now on my homepage and one other page i dont want to have the sidebar. On all other pages it needs to stay. How can i do this. Any help would be appreciated. […]

Use different javascript files for each page on website

I’m currently trying to create my first ever theme on wordpress. I’m hosting it locally until I can get it all working and then I will use the theme on a website. Everything was going great until I got to the javascript. Each page on the theme has a character counter box which counts up […]

Migrating a File from Plugin to Theme and changing its path → instead create a REST endpoint

<?php echo plugins_url().’/jamesplugin/assets/library/classes/process_mailchimp.php’;?> The above is path of a file that is kept in a plugin, but I want to transfer that file to a theme say here → inc/process_mailchimp.php For this plugins_url() what will be its theme-equivalent? Please let me know If I need to provide any extra information to you.

Working with an Array inside Your Theme Options Array – Multiple Values

I apologize if this is covered extensively elsewhere, I’m not sure how to phrase my searches on the topic. Basically, instead of the following standard code to store data in WP-options… $options = array ( array(“name” => __(‘Font’,’mytheme’), “desc” => __(‘Change the font face)’,’mytheme’), “id” => “mytheme_font”, “std” => “Arial”, “type” => “text”), array(“name” => […]

Renaming the Twenty Fourteen WordPress theme

I know the benefits of creating child themes, but it in my case I really would like to create a theme based upon another one without any dependencies to a parent theme. I tried to use a sed command to replace all occurrances of ‘Twenty Fourteen’/’Twenty_Fourteen’/ ‘twentyfourteen’ in all files, but that just doesn’t seem […]

Can I rename a theme's folder and still receive updates?

I’m using a theme that I’ve pulled from WordPress’ repo (example: Twenty Sixteen), the default URL structure looks like so:… I want to hide any reference that this WordPress theme is coming from Twenty Sixteen and customize the directory to something else:… While I can FTP to my website and rename the folder […]