Articles of theme development

Custom admin logo not showing after wordpress 4.5 upgrade

I have just upgraded to wordpress 4.5 and now my custom logo for the admin doesn’t work, the theme which I built uses the following in the theme functions.php: /* change admin logo */ function my_login_logo() { ?> <style type=”text/css”> .login h1 a { background-image: url(<?php echo get_field(‘logo’,’options’); ?>); background-position: center center; background-repeat: no-repeat; background-size: […]

What are the allowable Tags values in a theme file header?

I suspect that any searchable term can be used in the “Tags” header in the File Header for a theme. The codex discusses the File Header Requirements here https://codex.wordpress.org/File_Header but does not explain how to choose which values to assign to “Tags”.

Bootstrap grid system is not working in my WordPress theme

I’m a long time WordPress user but this is the first time I dared to build my own theme (while following a tutorial though). I’m trying to use Bootstrap as the layout tool for the theme, but for some reason I can’t get it to work. Here is the work-in-progress: http://youtubeen.com/ I’m expecting the three […]

WordPress Load Only Page Text

I’m working on a page template and I need the_title to be separate from the page text. I’m not sure how to load the_content without it having the title. Can anyone help?

How to call a widget in a loop at a specific iteration value?

On the index page of my website. I want to display a widget in the third position. I am calling the widget through “the_widget( ‘Widget Name’ );” code. Now the problem is, since it doesn’t return anything. It will display the widget in the first position in my loop. Is there any way, I can […]

Fixed button and slideshow in template upload per page

For all products there is a different page. Every product page will have the product template. On this template I’ll have 3 download buttons and a slideshow. Now I want that when making a page for a product that there is a option to upload 3 PDF’s (for the download buttons) and up to 5 […]

How to use Internationalized human_time_diff() function in Chinese?

Looking at https://codex.wordpress.org/Function_Reference/human_time_diff I’m using an English version of WordPress. In my theme template, I would like to define custom text of min, hour, day, week, month, year in Chinese using human_time_diff() when looping through posts. According to the instruction in the Codex documentation: <?php printf( _x( ‘%s ago’, ‘%s = human-readable time difference’, ‘your-text-domain’ […]

Shortcode call not working in WP Template

I’m working with a Visual Composer shortcode to call a text resizer into being. When using the Visual Composer or the classic WYSIWYG, if I insert it’s shortcode [enlarge_text small=’A’ medium=’A’ large=’A’ default_value=’medium’] into the editors it works with 0 issue. So in the interest of making my life easier, I went to add this […]

Where to put custom page templates in theme?

I am building a theme (parent theme) and I was advised to put custom page templates in theme root folder. I am copying theme twenty fourteen and found this theme using a separate directory called page-templates for keeping custom page templates but it does not work with my theme? Can i know why twenty fourteen […]

get_page_templates only return templates with “home” in the filename

I have the following custom page template filenames: template-about-1.php template-about-2.php template-home-1.php template-home-2.php I have this function to get_page_templates: function get_page_templates_select() { $teh_cats = get_page_templates(); foreach ( $teh_cats as $template_name => $template_filename ) { $results[] = $template_name; } return $results; } How can I modify the function to ONLY return the templates that have “home” in […]