Adam the Horrible
|
I don't want titles to show up on every page, but do want them on some pages. How do I specify a specific page to hide titles, eg. something like this below (which I have on a non-Artisteer theme):
}
.page-3 .page-title{
display: none;
}
|
|
Garry
|
You need to create new page templates for your theme, assign each new page template to each page and remove the code that generates page titles from the templates of your choice, you can create/assign new page templates as following:
Copy all code from page.php, create a new file(.php) name it any of your choice and paste the copied code in it, add following code on top of it:
<?php
/*
Template Name: new template
*/
?>
Upload that file into your theme folder and your new template will be available to you to choose from a drop down list when you add new page or edit existing page.
You can change this template's structure to your needs; you can assign a new name to your sidebar and you’ll be able to add desired widgets to this sidebar from widgets page. Now you can use this page template on pages where you need different structure and different set of widgets
------------------------------------
You can remove page titles from a page template by deleting following code from a page template:
<h2 class="art-PostHeaderIcon-wrapper">
<span class="art-PostHeader"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>">
<?php the_title(); ?>
</a></span>
</h2>
To also remove dateauthor etc remove following code also.
<div class="art-PostHeaderIcons art-metadata-icons">
<?php echo implode(' | ', $icons); ?>
</diV>
|
|
Adam the Horrible
|
So, it can't be done via style.css?
|
|
Adam the Horrible
|
Garry said, "You can change this template's structure to your needs; you can assign a new name to your sidebar and you’ll be able to add desired widgets to this sidebar from widgets page. "
If I'm following you correctly, the same thing can be accomplished with the plugin Widget Logic, to control where widgets appear (without the need of creating new sidebars).
|
|
Bud
|
It can be done with CSS after you make one change to the header.php file to add semantic classes to your theme. This is assuming you're using WP 2.8.
In your header.php file change this...
<body >
To this...
<body <?php body_class(); ?>>
Now you will be able to isolate the page with CSS.
When you inspect the page with Firebug or view the source you can find out what the page ID is. One one of my pages it looks like this...
<body class="page page-id-37 logged-in">
So I know that I want to style "page-id-37" to remove the title block. I put the following at the end of my style.css file...
.page-id-37 .art-PostHeaderIcon-wrapper, .page-id-37 .art-PostHeaderIcon-wrapper a, .art-PostHeaderIcon-wrapper a:link, .page-id-37 .art-PostHeaderIcon-wrapper a:visited, .page-id-37 .art-PostHeaderIcon-wrapper a:hover {
display:none;
}
That's what I do for all my themes. I even modified the Artisteer program file to include this automatically for the body tag.
Bud
budstechshed.com
|
|
Adam the Horrible
|
Thank you!
|
|
Garry
|
You can hide page titles by adding property "display:none" in following styling rule but it'll hide page titles in all of the pages:
.art-PostHeader {
color:#1E4D57;
font-family:Arial,Helvetica,Sans-Serif;
font-size:22px;
font-style:normal;
font-variant:normal;
font-weight:bold;
letter-spacing:normal;
line-height:inherit;
margin:0.2em 0;
padding:0;
text-align:left;
text-decoration:none;
text-indent:0;
text-transform:none;
word-spacing:normal;
}
|
|
Adam the Horrible
|
Garry said:
"....but it'll hide page titles in all of the pages"
Thanks, Garry. I guess that is true for pre-2.8 versions of Wordpress and themes that haven't implemented some of the features of Wordpress 2.8+. WP 2.8+ allows for more page-specific and post-specific controls in style.css. Bud shows how to adjust Artisteer themes to allow for this, too, in WP 2.8+.
|
|
Bud
|
Semantic classes can also be implemented in Artisteer themes that allow it to be compatible with older versions of WP. It's just a little bit more involved but not much.
You do it the way it's been done in the Sandbox theme or the Thematic framework. I've also modified Artisteer themes to use this technique and it gives you even more control over your CSS.
Bud
budstechshed.com
|
|
Garry
|
@ Adam
Bud's approach is totally different, it is also a good approach using semantic classes, but my conclusion is specific to just Artisteer generated themes in which we are just talking to hide page title with "display:none" property.
|
|
Adam the Horrible
|
OK, I can see that. I appreciate seeing both helpful responses and approaches. Thanks.
|
|
Adam the Horrible
|
To create a gallery page I succeeded in making a page specific change in style.css. I did this by changing <body > to <body <?php body_class(); ?>> as Bud suggested, creating a new page template, using Garry's solution, this one without sidebars, and adding this code below:
`}
.page-id-15 .art-contentLayout .art-content
{
position: relative;
margin: 0;
padding: 0;
border: 0;
float: left;
overflow: hidden;
width: 787px;
} `
|
|
fpdesign
|
Quote Garry:
You can hide page titles by adding property "display:none" in following styling rule but it'll hide page titles in all of the pages:
.art-PostHeader {
color:#1E4D57;
font-family:Arial,Helvetica,Sans-Serif;
font-size:22px;
font-style:normal;
font-variant:normal;
font-weight:bold;
letter-spacing:normal;
line-height:inherit;
margin:0.2em 0;
padding:0;
text-align:left;
text-decoration:none;
text-indent:0;
text-transform:none;
word-spacing:normal;
}
Where ?????????
|
|
fpdesign
|
Where can i find the styling rule ?
Page.php?
thanx
|
|
Adam the Horrible
|
Quote fpdesign:
Where can i find the styling rule ?
Page.php?
thanx
That would be in style.css
|
|
Garry
|
Yes, you can find it in style.css in your theme files
|
|
fpdesifn
|
thanxs i solved with the title and the comment , with this script
remove
<?php comments_template(); ?>.
from
Template pagine (page.php)
remove title
You can find that code from line 9-13 in page.php of Artisteer generated Wordpress theme:
<h2 class="art-PostHeader">
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>">
<?php the_title(); ?>
</a>
</h2>
another question .
This is the site
http://www.visualproject.it/vp/
How to move down the search box , i need the two elements allined .
Any solution?
|
|
Garry
|
Do you wanna move entire block down or just the search box
|
|
fpdesign
|
Quote Garry:
Do you wanna move entire block down or just the search box
The entire block , can you explain the difference?
|
|
Tanya
|
I can't find the page ID on any page on either of the websites I just built using Artisteer and Wordpress. I checked both in FIrebug and looking at the source code. What am I missing?
I got rid of all my headers so I could put them in on my "static" pages the way I wanted, but I lost them on the posts. I'd like to try changing the CSS but will try the new page template if I can't find the page ID
http://nargsemerald.org
|
|
Myles
|
Tanya,
When you're viewing the source code of a page, click on "edit" then "Find" - Type in "page-item" (without quotes) and it will find the navigation links for your site. each page-item will have a number associated with it. That's the page id.
Hope this helps.
Myles
|
|
Garry
|
@ Tanya
Simply open the page in browser, it'll show the page ID at last of URL(in case of default permalinks)
|
|
Dirk
|
Quote Garry:
You can remove page titles from a page template by deleting following code from a page template:
<h2 class="art-PostHeaderIcon-wrapper">
<span class="art-PostHeader"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>">
<?php the_title(); ?>
</a></span>
</h2>
Hi Garry,
with the new version of Artisteer the page.php does not include this code.
How or where can I hide the headline now?
Best Regards
Dirk
|
|
Dirk
|
Hi have the solution
I deleted the file post_title.php in the folder "templates" and now it works.
|
|
Dirk
|
My last solution was wrong.
You have to change the code inside of the templates/post.php to this code:
<div class="art-post">
<div class="art-post-body">
<div class="art-post-inner art-article <?php echo $post_class; ?>" <?php echo $post_id; ?>>
<?php echo $post_thumbnail; ?>
<?php if (is_page() || is_single()) { $post_title = false;} else echo $post_title; ?>
<?php echo $post_metadataheader; ?>
<div class="art-postcontent">
<!-- article-content -->
<?php echo $post_content; ?>
<!-- /article-content -->
</div>
<div class="cleared"></div>
<?php echo $post_metadatafooter; ?>
</div>
<div class="cleared"></div>
</div>
</div>
Than it works.
Good luck.
Dirk
|
|
Micky
|
Sorry guys, but I've tried every solution suggested in all the Wordpress.org and Artisteer.com forum threads I could find on how to hide a page title, but it just won't work on this site I've just finished.
I've created Wordpress websites before, designed with Artisteer, and have never had any problems with this before. I now use the very latest versions of both Artisteer and Wordpress, maybe something's changed?
I ONLY want to hide my Homepage title, and I've tried doing this in various ways in the page.php file (but H2 is not in there) , the index.php, the style.css file - but nothing worked.
I then noticed there's a post_title.php file and I think I need to add a line in there to indicate I want to hide the title from one single page. I don't know PHP coding so I don't understand exactly how/where/what to insert.
This is what the file currently says:
<h2 class="art-postheader">
<a href="<?php echo $post_link; ?>" rel="bookmark" title="<?php echo $post_link_title; ?>">
<?php echo $post_title; ?>
</a></h2>
The page ID of my homepage is 2. Can anyone tell me what I should do to hide the title on that particular page only?
Thanks very much for your help.
|
|
Adeptris
|
Do not show titles on home or front page
?php if( ! (is_front_page() || is_home() ) ) : ?>
<h2 class="art-postheader">
<a href="<?php echo $post_link; ?>" rel="bookmark" title="<?php echo $post_link_title; ?>">
<?php echo $post_title; ?>
</a></h2>
<?php endif; ?>
|
|
Adeptris
|
Missing the < in the last post, just read it again and you have the ID so
Condition Reads: If not (not = ! ) is page 2 then (then = : )
<?php if( ! is_page( '2' ) ) : ?>
<h2 class="art-postheader">
<a href="<?php echo $post_link; ?>" rel="bookmark" title="<?php echo $post_link_title; ?>"> <?php echo $post_title; ?> </a></h2>
<?php endif; ?>
|
|
Micky
|
Hi Adeptris,
Thank you so much - that worked!!
I'm very impressed, because I had tried every single "solution" I'd found for this problem already and absolutely nothing worked.
This was exactly what I needed, thanks again, it's very much appreciated!
Micky
|
|
Micky
|
In case anyone wants to see it, here's a link to that website I've created in Artisteer, hiding the HOME page title (only on the homepage) using the code provided above by Adeptris.
<a href="http://www.claremontonthebellinger.com.au/">Claremont Homestead</a>
OK, I can't preview this and I don't know for sure the above code worked, so here's the straight URL: http://www.claremontonthebellinger.com.au/
Thanks again,
Micky
|
|