2 edb Sep 22, 2006 00:02

Edb- that's not what I had in mind. All I want out is the words "post details" - I still want everything else (i.e. last comments, etc). This has to be defined somewhere right?
Exactly...
in 0.9 you had a list of all the titles, and you could easily delte 1 title that you don't want..
Now it is just 1 function..
I have no solution for you (yet)
Maybe try.. inc/_misc/_template.funcs.php
default:
// We are displaying (a) message(s)...
if( $preview )
{ // We are requesting a post preview:
$r[] = T_('PREVIEW');
}
elseif( intval($p) )
{ // We are requesting a specific post by ID:
if( $Item = & $ItemCache->get_by_ID( $p, false ) )
{
$r[] = T_('Post details').': '.$Item->get('title');
}
}
elseif( !empty( $title ) )
{ // We are requesting a specific post by title:
if( $Item = & $ItemCache->get_by_urltitle( $title, false ) )
{
$r[] = T_('Post details').': '.$Item->get('title');
}
}
I'm not sure though!!
At the skin or in the core?
At the skin you can make that bit be conditional:
<?php
// ------------------------- TITLE FOR THE CURRENT REQUEST -------------------------
if( $disp != 'single' ) {
request_title( '<h2>', '</h2>' );
}
// ------------------------------ END OF REQUEST TITLE -----------------------------
?>
In the core you go where John just pointed and change both instances of
$r[] = T_('Post details').': '.$Item->get('title');
to
$r[] = '';
<?php
// ------------------------- TITLE FOR THE CURRENT REQUEST -------------------------
if( $disp != 'single' ) {
request_title( '<h2>', '</h2>' );
}
// ------------------------------ END OF REQUEST TITLE -----------------------------
?>
Neat... thanks for that.
If what you want to do is get rid of the preamble in the Title
eg: T_('Post details').': ' etc etc
simply delete everything between the $r[] = and the $Item->get('title');
so go from
$r[] = T_('Post details').': '.$Item->get('title');
to
$r[] = $Item->get('title');
Very cool. Did the one where it's conditional to the skin. Thanks a lot!
John wrote:
If what you want to do is get rid of the preamble in the Title
eg: T_('Post details').': ' etc etcsimply delete everything between the $r[] = and the $Item->get('title');
so go from
$r[] = T_('Post details').': '.$Item->get('title');
to$r[] = $Item->get('title');
Where would I find the location of this file in ver 9.2? I want to change the "post details" text.
Thank you in advance,
DEL
Found it - core/_functions_bposts.php
I'm also trying to remove the "Post Details" string out of the title.
I tried the If statement but it didn't have any effect.
<title>
<?php
$Blog->disp('name', 'htmlhead');
request_title( ' - ', '', ' - ', 'htmlhead' );
?>
</title>
Is there an If block for request_title( ' - ', '', ' - ', 'htmlhead' );
Thanks
esanchez wrote:
Is there an If block for request_title( ' - ', '', ' - ', 'htmlhead' );
Thanks
Not until you make one.
<title>
<?php
$Blog->disp('name', 'htmlhead');
if( $disp != 'single' ) {
request_title( ' - ', '', ' - ', 'htmlhead' );
}
?>
</title>
This will remove the post title from the <title> tag when someone is on a single post page.
Hi EdB,
I tried the code but the If Statement Removes the "Blog Post Title"
So that I get
"Blog Name" instead of
"Blog Name : Blog Article Title"
Are there any parameters for the request_title() Function?
Is there a way to replace ("Post Details:") via php...
e.g. Replace("Post Details:", "");
Having "Post Details" really looks bad in searches and when others link to your articles via RSS.
thoughts?
To get a title for a permalink page that says "blog name - article title" will require hacking a core file. So let's go there! Searching http://doc.b2evolution.net/v-1-8/elementindex.html for "request_title" leads me to http://doc.b2evolution.net/v-1-8/evocore/_blogs---inc---_misc---_template.funcs.php.html#functionrequest_title which doesn't really help much, but does link to http://doc.b2evolution.net/v-1-8/__filesource/fsource_evocore__blogsinc_misc_template.funcs.php.html#a59 shows that lines 103 and 110 is where the text you want gone shows up. Therefore it's time to open up inc/_misc/_template.funcs.php, find that bit, and change it to suit your needs. Something like this is probably where you want to be:
elseif( intval($p) )
{ // We are requesting a specific post by ID:
if( $Item = & $ItemCache->get_by_ID( $p, false ) )
{
$r[] = $Item->get('title');
}
}
elseif( !empty( $title ) )
{ // We are requesting a specific post by title:
if( $Item = & $ItemCache->get_by_urltitle( $title, false ) )
{
$r[] = $Item->get('title');
}
}
Untested though, so the only promise I'll make is that I'll cheerfully refund your purchase price if this hack destroys your blog and causes global warming to escalate rapidly. (As someone who learned the hard way once said: backup all files you're about to edit before you realize you should have backed up all the files you're about to edit.)
EdB,
I realize I never thanked you for this workaround. Thanks.
It's working very nicely.
Delete (or better still comment out) that bit and you'll have your post title but not the "post detail" bit. You also won't have page titles for stuff like archives and profile pages. Others too I'm sure, like category-specific titles. Anyway I'm pretty certain removing or commenting out it will remove the bit you don't want from your permalink pages.