Forums

Custom title tag for page included into Wordpress (5 posts)

  1. Jetoile
    Member
    Posted 7 months ago #

    Here's the skinny. I'm using Wordpress to wrap around a custom page of mine, however because it isn't fully recognized by Wordpress, the title HTML tag is blank eg. <title></title>

    Is there an easy way, via either a hook or a filter to replace the title tag? I've tried the following, but I don't seem to be on the right track. Any help would be excellent.

    function page_title(){
    
    	$output = '<title>Custom Title</title>';
    	echo apply_filters('page_title', $output);
    }	
    
    add_action('wp_head','page_title');
  2. Jetoile
    Member
    Posted 7 months ago #

    Anyone have any ideas? The above code adds a title html tag, but what I need it to do is remove the original title tag as well.

  3. Jetoile
    Member
    Posted 7 months ago #

    Still trying to find a fix for this. It can't be that hard.

  4. iridiax
    Member
    Posted 7 months ago #

  5. stevejohnson
    Member
    Posted 7 months ago #

    Write it with javascript. In your custom page code:

    <script type="text/javascript">
      document.title = "Your new title here";
    </script>

Reply

You must log in to post.

About this Topic