Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

After Tcattd kind reply, I was able to load some text, from a post content, inside a div tag along the page, but now, the name of the most recent added post was added to the HTML document title; that is, what was "This is the Blog Name" became "Last Post Added | This is the Blog Name". I'm just using posts to load/edit content inside specific parts(divs) of my static pages, can't have them on the site title. How do I hide them? Once more, thanks in advance.

share|improve this question
can you clarify your question? it doesn't make any sense to me. links and sample code also help. – helgatheviking Mar 12 '12 at 22:24
Thx, helgat. The issue is hiding the latest added post title from the site's title. For instance, if my site name is "This is the Blog Name", after I load a new post's content to a div tag, called "Last Post Added", the site's title became "Last Post Added | This is the Blog Name". – luprates Mar 13 '12 at 0:43
I guess I have to filter wp_title, not sure how. – luprates Mar 13 '12 at 0:46
do you mean the title that appears in the top of your browser? wp_title doesn't add the site name by default, that is usually done in header.php of your theme between the <title> tags (unless i still misunderstand you) – helgatheviking Mar 13 '12 at 0:54

closed as too localized by toscho Jan 3 at 23:21

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

2 Answers

As helga indicated, it is in the title tag in the header. If your intent is to just have the blog name, replace the content of your tag with this

<title><?php bloginfo( 'name' ); ?></title>

As a follow-up to your comment. At the top of your browser, there is

Post Name | Blog Name

and you want to remove Post Name, but keep Blog Name.

If you have the following code in your wrapped in your title tag, remove it.

global $page, $paged;

wp_title( '|', true, 'right' );
share|improve this answer
Sorry for the confusion. I guess this is a pretty dumb question. Let me try again: I already have <title> <?php bloginfo('name'); ?> </title>. Whem I add post: <div id="txt01"> <p><i><?php query_posts( 'p=64' ); while (have_posts()) : the_post(); the_content(); endwhile; ?></i></p> </div>, this post name is now part of the title that appears in the top of the browser. – luprates Mar 13 '12 at 13:21
Thx for ur patience, Michael. I only have code<title><?php bloginfo( 'name' ); ?></title> code as the title definition, nothing else. – luprates Mar 14 '12 at 1:23

My mistake after all. Just realized I needed

<?php wp_reset_query(); ?>

to reset my mini-loop area:

<div id="txt01">
<?php query_posts( 'p=58' );
    while (have_posts()) : the_post();
        the_content();
        endwhile; ?>
<?php wp_reset_query(); ?>
</div>

Hope this can help more noobs like me.

share|improve this answer
As an aside (since you are a self-admitted noob), please avoid the use of query_posts. It causes all sorts of weird issues, as you're finding out, and there are safer (and sometimes easier) ways to do anything you could use it for. Search this site for query_posts and you'll find a number of questions dealing with it. – SickHippie Jun 19 '12 at 22:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.