Options: Per Page and Per Post
Per Page and Per Post Options
One of the most powerful features Weaver provides for customizing the content of your site is the set of Weaver Options for This Page andWeaver Options for This Post. When you create or edit a Page or Post from the admin page, you will see one of those two areas below the Editor box. They contain options that will be applied to that specific page or post. These settings often correspond to setting you find on the Standard Weaver Main Options or Advanced Options pages. Any settings made on the per page boxes will override the standard settings.
Weaver Options for This Post
The per post settings allow you to control excerpts, featured image, and author avatar. In addition, if you mark the post as a favorite, the post will be displayed with a yellow star to its left on all but the single post full page.
Per Page and Post Style allows you to add CSS styling to a specific post or page. To add CSS, you place rules in the Per Page/Post Style box. Each rule should be bracketed by the usual {}’s, and you should not add the <style> and </style> tags. If you want the rule to apply to the entire post, you would just provide the {}’s with no class or id name. If you are styling a specific element in the post (e.g., ‘.post-title a’ for the post’s title), then add the class or id name. (See the example below.) Weaver will automatically add a post specific id (in the form ‘#post-nnn’) to the beginning of each rule you provide. Note that this means you cannot combine classes into one rule (e.g. ‘.class1, .class2 {style info}’). Use a separate rule for each class or id.
For example, to put a yellow background with a border and some padding around the post, plus make the title italic, add the following CSS to the Per Post Style box:
{background-color:yellow; border:1px solid blue; padding:5px;} /* style entire post with these styles */ .post-title a {color:red; font-style:italic;} /* make the title red and italic */
The above rules will be prefixed with #post-nnn or .page-nnn for posts and pages, respectively.
Here’s a list of most of the elements of a post:
- .post-title – the title (this is .page-title on the post Single View)
- .post-title a – needed to change colors since the entry title is really a link
- .entry-meta – the top info line
- .entry-date – the date
- .meta-sep – the info between the info line elements
- .vcard – author
- .entry-content – the actual post content
- .entry-utility – the bottom info line
- .cat-links – category on bottom info line
- .comments-link – the link to comments
If you want some other styling that will be used when the particular post is displayed, or if you need more control, you can prefix your rule with a plus (‘+’), and the #post-nnn will not be added. For example, say you are working on post 798 (remember you can see the post id in the per post option box) and you want to hide the featured image on the single page view only. Add this rule (the + will be removed):
+.single #page-798 .post-format {display:none;} If you need a joined class (e.g. #post-nnn.content-single), then put a vertical bar ('|') in front of your classes.
The per page options box has several groups of options. The first option simply has a link to the Weaver Page Templates documentation.
The Per Page Options section controls display of the page’s content title (Hide Page Title), as well as several aspects of the standard Header and Footer areas.
The Selective Display of Widget Areas allows fine control of which widget areas are displayed with the page. In addition to hiding specific standard widget areas, you can specify one of the Per Page Widget Areas to serve as a replacement for the standard Primary, Upper/Right, and Lower/Left sidebar areas; or an additional Top Widget area for that page. You simply add the name of one of the extra widget areas previously defined at the bottom of the Widget Areas tab.
The Menu “Placeholder” option is useful if you want a top-level menu item that doesn’t require a ‘dummy page’. This can be used if you have a set of sub-pages on the menu that have content, but you don’t want to create a dummy page for the top level item. When the item is clicked, nothing will happen.
The “Hide Page on the Primary Menu” option will hide the specific page from the automatically generated Primary menu. If you define a custom Primary menu, then this option isn’t really needed. This will not hide the page from the Page widget – you will have to use the exclude feature of that widget to hide the page there. One good use of this option is to remove obsolete pages from your primary menu, yet retain the page’s URL so that if other sites have linked to it, there will still be a page there.
The Settings for “Page with Posts Template” is explained above.
Custom Fields Mechanism
All of the per page and per posts options are saved using the standard WordPress Custom Fields mechanism. (If you ever wondered what that was for – well, it is very useful for saving per page values for templates like Weaver Xtreme to use!)
While this is a very powerful capability, and allows you incredible per page customization, you should be aware of one factor – these settings will work only with the Weaver theme. These settings are associated with each individual page. They are not part of your theme definition, and won’t be saved when you use Weaver’s Save/Restore tab. But they are saved with the page, so if you upgrade Weaver Xtreme, or even switch to an alternate theme, those settings will remain intact.
Note that Weaver Xtreme changed all the internal names of these options, so per page and per post values you may have set for Weaver II will not transfer to Weaver Xtreme. And even though you can switch themes without losing that information, other themes won’t know what to do with it, so your pages will most likely just display with the other theme’s default template. You might even have to re-set each page’s template after you go back to Weaver Xtreme. This all isn’t bad – but you should know what is going on.
Extra Per Page Options (including Post Single View)
For even more advanced control on a per page basis, Weaver will recognize other options that you must manually define in the Edit Page Custom Fields box. These options match equivalent global settings found on the Advanced Options tab, but apply on a per page basis.
Define page-head-code, and the value contents will be added to the <HEAD> section. This will be inserted into the <HEAD> Section after the settings in the global <HEAD> Section on the Advanced Options tab. You can include specific CSS rules here, but you must wrap them in a <style>…</style> block.
The other options match one to one with the equivalent Advanced Options HTML Insertion areas. For example, to add Per Page prewrapper content, define a Custom Field with the name prewrapper and a Value with the HTML you want to add. The insertion areas include:
prewrapper
postfooter
Following also supported by Weaver Xtreme Plus:
preheader
header
postheader
container_top
precontent
pagecontentbottom
postpostcontent
precomments
postcomments
prefooter
presidebar
fixedbottom
fixedtop