Creating a custom header

If you look at the Greyzed homepage you’ll see that it is a theme which is no longer under active development. I wouldn’t recommend this as you might not be able to get the most out of your WordPress site if your theme is out of date. That being said, if you don’t have the … Read more

header specific meta box result detect url

global $post; $header_meta = get_post_meta($post->ID, ‘page-header-meta’, true); if( isset( $header_meta ) ) { echo ‘<h1>’ . $header_meta . ‘</h1>’; } else { echo ‘<h1>Knowledgebase</h1>’; } What this portion of code does is it checks the ‘page-header-meta’ value according to the page being displayed. IF your parent page has the metavalue set then the header will … Read more

Set header for default posts page?

You could use a template. You just have to copy the file header.php and call the new file with the slug of the page testimonials. It would require 2 new files : header-testimonials.php and front-page.php. then you can call your custom header with get_header(‘testimonials’); See the template hierarchy. Just be sure Testimonials is your front … Read more

Dynamic Title for custom post types

I use something like this in my header.php: <title> <?php if(is_front_page()) echo “Front Page Title”; else if(is_404()) echo “Page Not Found”; else the_title(); echo ‘ | ‘.get_bloginfo(‘name’); ?> </title> Check out Conditional Tags for more information. As a Function() : functions.php function setTitle(){ global $post; $title = get_the_title(); $term = get_term_by( ‘slug’, get_query_var( ‘term’ ), … Read more

Adding header function to theme

This code adds theme support for custom headers which adds a new page under Appearance in the wp dashboard. function themes_custom_header_setup() { add_theme_support( ‘custom-header’, $defaults, array( ‘default-text-color’ => ‘fff’, ‘width’ => 1260, ‘height’ => 240, ‘flex-height’ => true, ‘wp-head-callback’ => ‘themes_header_style’, ‘admin-head-callback’ => ‘themes_admin_header_style’, ‘admin-preview-callback’ => ‘themes_admin_header_image’, ) ) ); } add_action( ‘after_setup_theme’, ‘themes_custom_header_setup’ ); … Read more