From 7a23e1603f2a029ac2be939a4f269efe1006e3af Mon Sep 17 00:00:00 2001 From: Joshua Roy Date: Thu, 15 Feb 2018 15:44:16 -0500 Subject: [PATCH] Fixing programs title tag --- grandchild-functions.php | 18 ++++++++++++++++++ templates/header.php | 1 - 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/grandchild-functions.php b/grandchild-functions.php index dbe7941..a380933 100644 --- a/grandchild-functions.php +++ b/grandchild-functions.php @@ -584,6 +584,24 @@ function program_archive_page_template( $archive_template ) { } add_filter( 'archive_template', 'program_archive_page_template' ); +//Modify title +add_filter( 'pre_get_document_title', 'graduateschool_title', 50); +add_filter( 'wds_title', 'graduateschool_title', 50); + +function graduateschool_title( $title ) { + if ( is_post_type_archive('programs') ) { + $title = 'Degree & Certificate Programs | '.get_bloginfo( 'name' ); + } + return $title; +} + +//Add title tag theme support +add_action( 'after_setup_theme', 'graduateschool_title_tag' ); +function graduateschool_title_tag() { + + add_theme_support( 'title-tag' ); +} + //ACF Code if( function_exists('acf_add_local_field_group') ): diff --git a/templates/header.php b/templates/header.php index 5155f3f..98f90a1 100644 --- a/templates/header.php +++ b/templates/header.php @@ -16,7 +16,6 @@ include get_template_directory().'/inc/vars.php'; -<?php wp_title( '|', true, 'right' ); ?>