Tag: theme
-
Drupal template suggestions
To find out possibilities for naming template files add following line to related template hook in your template.php eg THEME_preprocess_HOOK(): print_r($variables[‘theme_hook_suggestions’]); Some hooks to look at _html, _page, _node, _block, _pane, _views_view_field, _comment, _search_result, _search_results, _user_profile.
-
Disable wordpress core updates display
Ever had a situation where you have given admin right to the client? What usally happens is that client will update the wordpress core. If we are talking about custom solutions, its most definitely not safe to update the core. Here’s a solution for disabling the opportunity to update WordPress core. add_action( ‘init’, create_function( ‘$a’,…
-
Show custom field if one exists
Often we have custom fields in containers ( DIV, SPAN etc. ) designed by CSS. Here’s a solution for displaying custom field content, if one exists. <?php if ( get_post_meta($post->ID, ‘custom-field-name’, true) ) : ?> <?php echo get_post_meta($post->ID, ‘custom-field-name’, true); ?> <?php endif; ?>