Recent Topics

1 Nov 13, 2006 18:52    

When I click on a Permalink in the Browser title at the top of the screen (not the post)I get an extremely long title in the top screen with my blog name, then short description then finally the post name

What I'm looking to do is have say only the post name with my blog name put after it.

Anyone have anyidea how i would do this?

2 Nov 14, 2006 05:04

Hi Nathan,

just a quick tip: always leave a link to your site so we can check out the problem...

Having said that, I think you're issue can be resolved by editing the "_main.php" file under your skin folder.

Look for this section at the beginning of the page

<title>YourMainTitle
<?php
$Blog->disp('name', 'htmlhead');
arcdir_title( ' - ', 'htmlhead' );
last_comments_title( ' - ', 'htmlhead' );
profile_title( ' - ', 'htmlhead' );
single_cat_title( ' - ', 'htmlhead' );
single_month_title( ' - ', 'htmlhead' );
single_post_title( ' - ', 'htmlhead' );
stats_title( ' - ', 'htmlhead' );
?>
</title>

You can add & remove tags from here.

Hope this helps.

Edgar.

3 Nov 16, 2006 22:57

Ah sorry about that, my site is www.nathancolquhoun.com

Now, I've seen posts that recommend to look at that set of code to change it, my only problem is that when its on my main index page I want it to say

"Based on a True Story - The Weblog of Nathan Colquhoun"

In the title.

If its linked to a permalink I want it to say

"Title of Post - Based on a True Story"

So i'm not great at starting up my own codes or anything, but i'm assuming I need to have an if statement somewhere saying that if its on the index page, keep the title as it is, if its on a permalink page change the title to something else. Any help would be appreciated.

4 Nov 16, 2006 23:18

The code snippet above is the old way of doing a page title. Since you're using version 1.8.2 you should be using the new way - if that's the code you have in your skins/skinname/_main.php file. The new way looks like this:

	<title><?php
		$Blog->disp('name', 'htmlhead');
		request_title( ' - ', '', ' - ', 'htmlhead' );
	?></title>

You can tweak this to do what you want.

	<title><?php
		if( $disp != 'single' ) {
			$Blog->disp('name', 'htmlhead');
			request_title( ' - ', '', ' - ', 'htmlhead' );
			} else {
			request_title( '', 'Based on a True Story', ' - ', 'htmlhead' );
			}
	?></title>

Hmmm... I think you'll still have "Post details:" in the title. Maybe this will work, but it's a best guess at this point. Hopefully you'll test it and let us know when it works ;)

	<title><?php
		if( $disp != 'single' ) {
			$Blog->disp('name', 'htmlhead');
			request_title( ' - ', '', ' - ', 'htmlhead' );
			} else {
			$Item->title( '', ' - ', false, 'htmlhead' );
			$Blog->disp('name', 'htmlhead');
			}
	?></title>

5 Nov 16, 2006 23:34

Thanks for your help with this EDB, I've noticed over the past while when searching through these forms, your responses always seem to help me out the most. I used your first one.

 <title><?php
      if( $disp != 'single' ) {
         $Blog->disp('name', 'htmlhead');
         request_title( ' - ', '', ' - ', 'htmlhead' );
         } else {
         request_title( '', ' - Based on a True Story', ' - ', 'htmlhead' );
         }
   ?></title>

That worked beautifully, but you were right and it gave me the post details which I didn't want, so i tried your second one, and I got this error.


Fatal error: Call to a member function on a non-object in /home/sejugszm/public_html/blog/skins/crystalglass/_main.php on line 41

6 Nov 17, 2006 00:24

Let's hope someone comes along who can figure out how to do it in your skin, else the only way is to hack it. I gotta get busy with the real world right now, but if no one hooks you up I'll see what I can come up with.

BTW the problem with the second is that $Item hasn't been figured out yet even though the actual item is already known.

7 Nov 17, 2006 01:04

I went into inc/_misc/_template.funcs.php and simply removed where it was telling it to post Post Details in two different places and that did exactly what I was looking for. That may be the cowards way out, but it worked.

8 Nov 17, 2006 10:52

I sorta knew that would work, but wanted to come up with a skin-based solution. One day you'll want to upgrade your version, and when you do that you'll lose hacks to core files. Your skin might need tweaking, but tweaking a skin is better than trying to re-figure-out all your hackage.

Anyway I'm glad you found resolution to your issue. I suppose I should say "you can hack blahblah file OR look for a skin-based solution" when that is appropriate.

Life is Good!

9 Jan 23, 2007 22:17

Hi,
I also looked for a solution to remove "Post Details" without going into the core files.
I came up with this, which seems to work. Can someone find anything that might give me a problem in the future?

In _main.php:

<title><?php
		$Blog->disp('name', 'htmlhead');

            if( $disp != 'single' )
             request_title( ' - ', '', ' - ', 'htmlhead' );
            else
            {
              $Item = $MainList->get_item();
              echo ' - ';
              echo $Item->title();
              $MainList->restart();
            }
	?></title>


Form is loading...