How do I white label my self-hosted site created by wordpress?

Here is the code I always use whenever I setup a new wordpress blog: CUSTOM ADMIN FOOTER TEXT // CUSTOMIZE ADMIN FOOTER TEXT function custom_admin_footer() { echo ‘<a href=”http://www.netconstructor.com/”>Website Design by NetConstructor, Inc.</a>’; } add_filter(‘admin_footer_text’, ‘custom_admin_footer’); REMOVE VERSION INFO FROM THE HEAD OF FEEDS // REMOVE VERSION INFO FROM THE HEAD OF FEEDS function complete_version_removal() … Read more

How to prevent plugin, theme installation failures on WordPress?

headdesk Permissions on all WordPress files should be 644. Permissions on all WordPress directories should be 755. Exceptions: The uploads directory may need to be 775 or 777, depending on your server configuration. wp-config.php should be 600, 640, or 644, whatever is the lowest number that works. Never, ever, give higher permissions than those. That … Read more

“Unexpected error” on update requests

Navigating WP admin in general tends to trigger multiple external requests, such as fetching news feeds and theme/plugin updates (not counting whatever plugin/themes might be doing on their own). You can put configuration constants into wp-config.php to block external requests completely/partially: define( ‘WP_HTTP_BLOCK_EXTERNAL’, true ); define( ‘WP_ACCESSIBLE_HOSTS’, ‘api.wordpress.org,*.github.com’ ); Or configure external requests to use … Read more

How do I add support to my theme for custom menus?

The easiest way is to use the register_nav_menus function.This should be hooked into ‘after_setup_theme’: function my_cool_menu_function(){ register_nav_menus( array( ‘primary’ => ‘Primary Navigation’ )); } add_action( ‘after_setup_theme’, ‘my_cool_menu_function’ ); Then, in your theme, simply call that menu’s position: wp_nav_menu( array( ‘theme_location’ => ‘primary’ ) );

how to override woocommerce specific loop or archive-product.php [closed]

The WooCommerce templating works in different ways depending on your needs and/or skills. The function: <?php wc_get_template_part(‘content’, ‘product’); is the WooCommerce equivalent of WordPress core template function: <?php get_template_part(‘filename’); It is important to know that this is the same as php require but without using .php extension at the end. Before you do any of … Read more

Dash or underscore in theme folder name?

In short, there is no well defined convention for naming a theme’s directory, and all of the following are valid (among others): my_wordpress_theme my-wordpress-theme (empirically the most popular option within the ecosystem) MyWordPressTheme mywordpresstheme (what the default themes use) Details The WordPress PHP Coding Standards Handbook states that filenames should be all lowercase and hyphen-separated. … Read more

My child theme doesn’t work Error: “The parent theme is missing. Please install your parent theme”

There are three things to check: Is your parent theme complete and what is the exact spelling of the parent theme’s name in its style.css. Uppercase and lowercase are important. Is the child theme directory named parentname-child. It should be in the themes directory, not in a subdirectory of the parent theme. Does the child … Read more