Articles of themes

Getting rid of unused css directives

I bought a theme (developed on top of another theme as I discovered later), modified it deeply as a child theme and now I have thousands (more or less 15000) of css lines unused. Is there an efficient way of deleting what I don’t need. By efficient I mean not one by one. Do you […]

An unexpected error occurred when add theme

I recently install wordpress using wamp on my localhost. I try to change the theme by click on add new. I just want to explore the themes but got this message: An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support […]

WordPress Customizer Default Image

I’m trying to set a default image to a Customizer image with the code below but image does not display. <img src=”<?php echo get_theme_mod( ‘header_image’ , ‘<?php get_template_directory_uri(); ?>/images/default-image.jpg’ ); ?>”> Am I missing something?

Custom Post Type – Portfolio no longer works

I have a custom post type for a portfolio that used to work and now it no longer shows up in the admin menu. It does however show up in the admin bar but not in the dashboard, only when viewing the site. If I click to go to the portfolio section to add an […]

get_header action not working

I am trying to change the header template using the get_header action but it wont change anyway I try to do it. Here is what I tried by adding this in functions.php: function prefix_new_header() { return ‘newtmpl’; } add_action( ‘get_header’, ‘prefix_new_header’ ); I have in the theme folder a file called header-newtmpl.php I’ve tried different […]

Installing a theme on localhost, Ubuntu 16.04

I am using the LAMP stack, Ubuntu 16.04 LTS version. I installed WordPress and am trying to install a theme which I have in a .zip file When I try to install the uploaded theme (where WP clearly says I can upload a .zip file if I have it), I keep getting the following error […]

WP_Customize_Color_Control omitting # symbol

I am developing a theme and am struggling with WP_Customize_Color_Control. Sometimes it includes the # symbol before the color’s hex and sometimes it doesn’t. I have triple checked my code and cannot see why header_textcolor is the only color to omit it’s # symbol before the hex value in the resulting stylesheet (which prevents it […]

WordPress Theme and Plugin Name extraction

I have had a look at the source code of WordPress, as well as php.net for a possible answer. However, I was not able to get close to finding it. For the source code, I was assuming I would find it in one of the many files I checked in the wp-includes folder. However, there […]

Theme folder doesnt exist

I am using wordpress as a submodule and capristrano to deploy. The deployment seems to work correctly and i am able to log in to wp-admin, but when i look at my themes ERROR: The theme directory “sage-master” does not exist. The submodule setup adds the wp-content files to site_url.com/content ie site_url.com/content/themes site_url.com/content/plugins etc Within […]

Default Nav Highlight

I’m using the built-in menu functionality wp_nav_menu in my project: joshrodg.com/polio/, all of the posts (http://joshrodg.com/polio/star-wars/, http://joshrodg.com/polio/hello-world/, etc.) don’t belong to any of the items in the navigation bar (they are not listed in the navigation bar), therefore none of the links in the navigation bar get highlighted when the posts are being shown. I […]