Discuss your project

Category

Front

4 articles

WordPress: Add a new widget area to a WordPress theme

If you're familiar with WordPress themes, you know that many themes come with a widgetized sidebar. This means that you can add, remove, and rearrange widgets on your WordPress website using the "Widgets" section of your WordPress dashboard.Having a widgetized sidebar is very useful, but you may also want to widgetize other parts of your WordPress theme. It's quite easy to do, and once your theme is modified, it will be simple for you or the WordPress admini...

Apache: Overload htaccess authentication

To disable htaccess authentication, simply add a .htaccess to the root of the folder you wish to authorize with the following directive: Satisfy AnyOr you can place it directly in the vhost: Satisfy Any Compatibility context This procedure documents a PHP or Apache environment from its time. PHP 5.x and 7.x branches no longer receive standard support from the PHP project: do not deploy this configuration as is on a new server. First identify the versions actually installed and the loade...

WordPress: Override a template when a variable is present in the URL

In very rare cases, one might need to override the default template (although it's a bit dirty to do that).In the functions.php file, add the following code: function wpa_overload_template( $template ) { if( isset( $_GET['parameter'] ) ) { $template = locate_template('template-overload.php', false ); } return $template; } add_filter( 'template_include', 'wpa_overload_template' ); Reproduce this customization today The principle of the hook remains useful, but the administration screens ...

WordPress: Hide the default category on the front

To be placed in the functions.php file: add_filter( 'list_terms_exclusions', 'global_cat_exclude' ); function global_cat_exclude( $terms ) { if( !is_admin() ) $terms = "AND t.term_id != " . get_option( 'default_category' ) . " "; return $terms; } Reproduce this customization today The principle of the hook remains useful, but the administration screens and WordPress APIs have evolved since the publication. Test the code in a staging environment with the exact version of the site's core,...