function ttw_generate_wphead() { /* this guy does ALL the work for generating theme look - it writes out the over-rides to the standard style.css */ global $ttw_options, $ttwHeadOptions; printf("<!-- This site is using %s %s subtheme: %s -->\n", TTW_THEMENAME, TTW_VERSION, ttw_getopt('ttw_subtheme')); if (!ttw_getadminopt('ttw_hide_metainfo')) { echo str_replace("\\", "", ttw_getadminopt('ttw_metainfo') . "\n"); } // handle 3 stylesheed situations // default: used weaver-style.css // no weaver-style.css: when first installed, there will not be a weaver-style.css, so use inline instead // force inline: user wants inline css $css_file = ttw_get_css_filename(); // fetch the name of the css file if (ttw_getadminopt('ttw_force_inline_css') || !file_exists($css_file)) { // generate inline CSS get_template_part('ttw-generatecss'); // require_once('ttw-generatecss.php'); // include only now at runtime. echo '<style type="text/css">' . "\n"; $output = fopen('php://output', 'w+'); ttw_output_style($output); echo "</style> <!-- end of main options style section -->\n"; } else { printf("<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"%s\" />\n", ttw_get_css_url()); } /* now head options */ echo str_replace("\\", "", ttw_getopt('ttw_theme_head_opts')); echo str_replace("\\", "", ttw_getopt('ttw_head_opts')); /* let the user have the last word! */ do_action('ttwx_extended_wp_head'); /* call extended wp_head stuff */ do_action('ttwx_super_wp_head'); // future header plugin echo "\n<!-- End of Weaver options -->\n"; }
function childtheme_excerpt_length($length) { $val = ttw_getopt('ttw_excerpt_length'); if ($val > 0) { return $val; } return (int) $length; }
* after. Calls sidebar-footer.php for bottom widgets * * @package WordPress * @subpackage Twenty Ten * @since 3.0.0 */ ?> </div><!-- #main --> <?php if (!ttw_getopt('ttw_hide_blank_footer')) { ?> <div id="footer"> <div id="colophon"> <?php get_sidebar('footer'); echo do_shortcode(str_replace("\\", "", ttw_getopt('ttw_footer_opts'))); /* here is where the footer options get inserted */ do_action('ttwx_extended_footer'); /* anything in the extended footer */ $date = getdate(); $year = $date['year']; ?> <table id='ttw_ftable'><tr> <td id='ttw_ftdl'><div id="site-info"> <?php $cp = ttw_getadminopt('ttw_copyright'); if (strlen($cp) > 0) { echo str_replace("\\", "", ttw_getadminopt('ttw_copyright')); echo '</div></td>'; } else { ?>
function mytheme_put_main_options_form($ttw_options_list, $actname, $flabel, $showFirstInput) { /* output a list of options - this really does the layout for the options defined in an array */ echo '<form method="post"> <table class="optiontable">' . "\n"; if ($showFirstInput) { /* maybe show extra submit button at top */ // Don't change this - IE8 an IE9 have troubles if not done this way. // echo("<span class='submit'><input name='$actname' type='submit' value='$flabel' class = 'button-primary' /></span><br />"); echo "<input name='{$actname}' type='submit' value='{$flabel}' class = 'button-primary' /><br />"; } foreach ($ttw_options_list as $value) { if ($value['type'] == "text") { ?> <tr> <th scope="row" align="right"><?php echo $value['name']; ?> : </th> <td> <input name="<?php echo $value['id']; ?> " id="<?php echo $value['id']; ?> " type="text" style="width:80px" class="regular-text" value="<?php if (ttw_getopt($value['id']) != "") { echo ttw_getopt($value['id']); } else { echo $value['std']; } ?> " /> </td> <?php if ($value['info'] != '') { echo '<td style="padding-left: 10px"><small>'; echo $value['info']; echo "</small></td>"; } ?> </tr> <?php } elseif ($value['type'] == "ctext") { $pclass = 'color {hash:true, adjust:false}'; // starting with V 1.3, allow text in color pickers $img_css = '<img src="' . get_template_directory_uri() . '/images/weaver/css.png" />'; $img_hide = get_template_directory_uri() . '/images/weaver/hide.png'; $img_show = get_template_directory_uri() . '/images/weaver/show.png'; $help_file = get_template_directory_uri() . '/css-help.html'; $css_id = $value['id'] . '_css'; $css_id_text = ttw_getopt($css_id); if ($css_id_text && !ttw_getadminopt('ttw_hide_auto_css_rules')) { $img_toggle = $img_hide; } else { $img_toggle = $img_show; } ?> <tr> <th scope="row" align="right"><?php echo $value['name']; ?> : </th> <td> <input class="<?php echo $pclass; ?> " name="<?php echo $value['id']; ?> " id="<?php echo $value['id']; ?> " type="text" style="width:110px" value="<?php if (ttw_getopt($value['id']) != "") { echo ttw_getopt($value['id']); } else { echo $value['std']; } ?> " /> <?php echo $img_css; ?> <a href="javascript:void(null);" onclick="wvr_ToggleRowCSS(document.getElementById('<?php echo $css_id . '_js'; ?> '), this, '<?php echo $img_show; ?> ', '<?php echo $img_hide; ?> ')"><?php echo '<img src="' . $img_toggle . '" />'; ?> </a> </td> <?php if ($value['info'] != '') { echo '<td style="padding-left: 10px"><small>'; echo $value['info']; echo "</small></td>"; } ?> </tr> <?php if ($css_id_text && !ttw_getadminopt('ttw_hide_auto_css_rules')) { ?> <tr id="<?php echo $css_id . '_js'; ?> "> <th scope="row" align="right"><span style="color:green;"><small>Custom CSS styling:</small></span></th> <td align="right"><small> </small></td> <td> <small>You can enter CSS rules, enclosed in {}'s, and separated by <strong>;</strong>. See <a href="<?php echo $help_file; ?> " target="_blank">CSS Help</a> for more details.</small><br /> <textarea name="<?php echo $css_id; ?> " rows=1 style="width: 85%"><?php echo str_replace("\\", "", $css_id_text); ?> </textarea> </td> <?php } else { ?> <tr id="<?php echo $css_id . '_js'; ?> " style="display:none;"> <th scope="row" align="right"><span style="color:green;"><small>Custom CSS styling:</small></span></th> <td align="right"><small> </small></td> <td> <small>You can enter CSS rules, enclosed in {}'s, and separated by <strong>;</strong>. See <a href="<?php echo $help_file; ?> " target="_blank">CSS Help</a> for more details.</small><br /> <textarea name="<?php echo $css_id; ?> " rows=1 style="width: 85%"><?php echo str_replace("\\", "", $css_id_text); ?> </textarea> </td> <?php } ?> <?php } elseif ($value['type'] == "checkbox") { ?> <tr> <th scope="row" align="right"><?php echo $value['name']; ?> : </th> <td> <input type="checkbox" name="<?php echo $value['id']; ?> " id="<?php echo $value['id']; ?> " <?php echo ttw_getopt($value['id']) ? "checked" : ""; ?> > </td> <?php if ($value['info'] != '') { echo '<td style="padding-left: 10px"><small>'; echo $value['info']; echo "</small></td>"; } ?> <?php } elseif ($value['type'] == "link_checkbox") { // full implementation in next version ?> <tr> <th scope="row" align="right"><small>Options</small>: </th> <td> <input type="checkbox" name="<?php echo $value['id']; ?> " id="<?php echo $value['id']; ?> " <?php echo ttw_getopt($value['id']) ? "checked" : ""; ?> > </td> <?php if ($value['info'] != '') { echo '<td style="padding-left: 10px"><small>'; echo $value['info']; echo "</small></td>"; } ?> <?php } elseif ($value['type'] == "select") { ?> <tr> <th scope="row" align="right"><?php echo $value['name']; ?> : </th> <td> <select name="<?php echo $value['id']; ?> " id="<?php echo $value['id']; ?> "> <?php foreach ($value['value'] as $option) { ?> <option<?php if (ttw_getopt($value['id']) == $option) { echo ' selected="selected"'; } ?> ><?php echo $option; ?> </option> <?php } ?> </select> </td> </td> <?php if ($value['info'] != '') { echo '<td style="padding-left: 10px"><small>'; echo $value['info']; echo "</small></td>"; } ?> </tr> <?php } elseif ($value['type'] == "imgselect") { /* special handling of bullet images - will add the bullet image to each item */ ?> <tr> <th scope="row" align="right"><?php echo $value['name']; ?> : </th> <td> <select name="<?php echo $value['id']; ?> " id="<?php echo $value['id']; ?> "> <?php foreach ($value['value'] as $opt) { $img = get_template_directory_uri() . '/images/bullets/' . $opt . '.gif'; if ($opt == '') { /* special case - the empty default option */ $style = ''; } else { $style = ' style="background-image:url(' . $img . ');background-repeat:no-repeat;padding-left:16px;height:16px;line-height:16px;"'; } if (ttw_getopt($value['id']) == $opt) { $sel = ' selected="selected" '; } else { $sel = ''; } printf('<option%s%s>%s</option>', $sel, $style, $opt); echo "\n"; } ?> </select> </td> </td> <?php if ($value['info'] != '') { echo '<td style="padding-left: 10px"><small>'; echo $value['info']; echo "</small></td>"; } ?> </tr> <?php } elseif ($value['type'] == "header") { ?> <tr> <th scope="row" align="left"><?php echo '<a name="' . $value['id'] . '" id="' . $value['id'] . '"></a><br /><span style="color:blue;"><em><u>' . $value['name'] . '</u></em></span>'; ?> </th> <?php if ($value['info'] != '') { echo '<td> </td><td style="padding-left: 10px"><small><em><u>'; echo $value['info']; echo "</u></em></small> <a href=\"#top_main\">top</a></td>"; } ?> </tr> <?php } } ?> </table> <br /> <input name="<?php echo $actname; ?> " type="submit" value="<?php echo $flabel; ?> " class = "button-primary" /> <input type="hidden" name="action" value="<?php echo $actname; ?> " /> <?php ttw_nonce_field($actname); ?> <br /><br /> </form> <?php }
function ttw_advanced_admin() { global $ttw_options; $myName = esc_attr(get_bloginfo('name', 'display')); $myDescrip = esc_attr(get_bloginfo('description', 'display')); if (strcasecmp($myDescrip, 'Just another WordPress site') == 0) { $myDescrip = ''; } $headText = "<!-- Add your own CSS snippets between the style tags. -->\n<style type=\"text/css\">\n</style>"; $SEOText = "<meta name=\"description\" content=\" {$myName} - {$myDescrip} \" />\n<meta name=\"keywords\" content=\"{$myName} blog, {$myName}\" />"; if (!ttw_getopt('ttw_head_opts')) { ttw_setopt('ttw_head_opts', $headText); } // fill in something first time if (ttw_getadminopt('ttw_metainfo') == '' && !ttw_getadminopt('ttw_hide_metainfo')) { ttw_setadminopt('ttw_metainfo', $SEOText); } // fill in something first time ?> <div style="padding-right: 20px;"> <form name="ttw_options_form" method="post"> <input type="hidden" name="updated" value="1" /> <h3>Advanced Options </h3> <p><strong>Advanced Options - Insert your own code or snippets</strong> <?php /* <div style="float:right; width:33%; border:1px solid #888; padding-left:8px;"><small>Are you a professional website designer? If Weaver is helping you do your job, please make a donation to this theme!</small></div> */ ?> </p> <br /><input type="submit" name="saveadvanced" value="Update Advanced Options" class="button-primary" /><br /><br /> <fieldset class="options"> <p>This page has options for more advanced control of your site. Many of the fields on this page allow you to add HTML code (sometimes required by third-party plugins and widgets). While you can copy/paste/edit many of the CSS Snippets provided from the <b>Snippets</b> tab, it may be helpful if you understand a bit about HTML coding to used these fields most effectively.</p> <p>The values you put here are saved in the WordPress database, and will survive theme upgrades and other changes.</p> <p>PLEASE NOTE: NO validation is made on the field values, so be careful not to paste invalid code. Invalid code is usually harmless, but it can make your site display incorrectly. If your site looks broken after make changes here, please double check that what you entered uses valid HTML or CSS rules. Also note that backslashes will be stripped.</p> <hr /> <!-- ======== --> <label><span style="color:blue;"><b><HEAD> Section</b></span></label> <a href="#top_main">top</a><br/> This input area is one of the most important options in Weaver for customizing your site. Code entered into this box is included right before the </HEAD> tag in your site. The most important use for this area is to enter custom CSS rules to control the look of your site. Note: The <b>Snippets</b> tab (above) contains many examples of CSS rules to customize your site. <small>This field can also for entering JavaScript or links to JavaScript files or anything else that belongs in the <HEAD>. For example, Google Analytics code belongs here.</small> <br /> <textarea name="ttw_head_opts" rows=7 style="width: 95%"><?php echo str_replace("\\", "", ttw_getopt('ttw_head_opts')); ?> </textarea> <br /><br /> <!-- ==================================================== --> <hr /> <label><span style="color:blue; font-weight:bold; font-size: larger;">HTML Code Insertion Areas</span></label><br /> The following options allow you to insert HTML code into various regions of you page. These areas must use HTML markup code, and all can include <a href="http://codex.wordpress.org/Shortcode" target="_blank">WP shortcodes</a>. <em>Important:</em> You almost certainly will need to provide CSS styling rules for these code blocks, either as in-tag <em>style="..."</em> rules, or by adding CSS rules the the <HEAD> Section above. <br /><small>Note: Providing <em>margin</em> style values, including negative values, can be used to control the spacing before and after these code blocks.</small> <br /><br /> <!-- ======== --> <label><span style="color:blue;"><b>Pre-Header Code</b></span></label> <a href="#top_main">top</a><br/> This code will be inserted right before the header area (between the "wrapper" and the "header" div tags), above the menus and site image. This block also can be used as an alternative to the Weaver Header Widget Area. <br /> <textarea name="ttw_preheader_insert" rows=3 style="width: 95%"><?php echo str_replace("\\", "", ttw_getopt('ttw_preheader_insert')); ?> </textarea> <br /> <label>Hide on front page: </label><input type="checkbox" name="ttw_hide_front_preheader" id="ttw_hide_front_preheader" <?php echo ttw_getopt('ttw_hide_front_preheader') ? "checked" : ""; ?> /> <small>If you check this box, then the code from this area will not be displayed on the front (home) page.</small><br /> <label>Hide on non-front pages: </label><input type="checkbox" name="ttw_hide_rest_preheader" id="ttw_hide_rest_preheader" <?php echo ttw_getopt('ttw_hide_rest_preheader') ? "checked" : ""; ?> /> <small>If you check this box, then the code from this area will not be displayed on non-front pages.</small> <br /><br /> <!-- ======== --> <label><span style="color:blue;"><b>Site Header Insert Code</b></span></label> <a href="#top_main">top</a><br/> This code HTML will be inserted into the <em>#branding div</em> header area right above where the standard site header image goes. You can use it for logos, better site name text - whatever. When used in combination with hiding the site title, header image, and the menu, you can design a completely custom header. If you hide the title, image, and header, no other code is generated in the #branding div, so this code can be a complete header replacement. You can also use WP shortcodes to embed plugins, including rotating image slideshows such as <a href="http://www.jleuze.com/plugins/meteor-slides/" target="_blank">Meteor Slides</a>. And Weaver automatically supports the <a href="http://wordpress.org/extend/plugins/dynamic-headers/" target="_blank">Dynamic Headers</a> plugin which allows you create highly dynamic headers from its control panel - just install and it will work without any other code edits. <br /> <textarea name="ttw_header_insert" rows=3 style="width: 95%"><?php echo str_replace("\\", "", ttw_getopt('ttw_header_insert')); ?> </textarea> <br /> <label>Insert on Front Page Only: </label><input type="checkbox" name="ttw_header_frontpage_only" id="ttw_header_frontpage_only" <?php echo ttw_getopt('ttw_header_frontpage_only') ? "checked" : ""; ?> /> <small>If you check this box, then this Header code will be used only when the front page is displayed. Other pages will be displayed using normal header settings. Checking this will also automatically hide the standard header image on the front page so you can use a slide show on the front page, and standard header images on other pages.</small> <br /><br /> <!-- ======== --> <label><span style="color:blue;"><b>Post-Header Code</b></span></label> <a href="#top_main">top</a><br/> This code will be inserted right after the header area and before the main content area (between the "header" and the "main" div tags), below the menus and site image. <br /> <textarea name="ttw_postheader_insert" rows=3 style="width: 95%"><?php echo str_replace("\\", "", ttw_getopt('ttw_postheader_insert')); ?> </textarea> <br /> <label>Hide on front page: </label><input type="checkbox" name="ttw_hide_front_postheader" id="ttw_hide_front_postheader" <?php echo ttw_getopt('ttw_hide_front_postheader') ? "checked" : ""; ?> /> <small>If you check this box, then the code from this area will not be displayed on the front (home) page.</small><br /> <label>Hide on non-front pages: </label><input type="checkbox" name="ttw_hide_rest_postheader" id="ttw_hide_rest_postheader" <?php echo ttw_getopt('ttw_hide_rest_postheader') ? "checked" : ""; ?> /> <small>If you check this box, then the code from this area will not be displayed on non-front pages.</small> <br /><br /> <!-- ======== --> <label><span style="color:blue;"><b>Pre-Footer Code</b></span></label> <a href="#top_main">top</a><br/> This code will be inserted right after the main content area and before the footer area (between the "main" and the "footer" div tags). <br /> <textarea name="ttw_prefooter_insert" rows=3 style="width: 95%"><?php echo str_replace("\\", "", ttw_getopt('ttw_prefooter_insert')); ?> </textarea> <br /> <label>Hide on front page: </label><input type="checkbox" name="ttw_hide_front_prefooter" id="ttw_hide_front_prefooter" <?php echo ttw_getopt('ttw_hide_front_prefooter') ? "checked" : ""; ?> /> <small>If you check this box, then the code from this area will not be displayed on the front (home) page.</small><br /> <label>Hide on non-front pages: </label><input type="checkbox" name="ttw_hide_rest_prefooter" id="ttw_hide_rest_prefooter" <?php echo ttw_getopt('ttw_hide_rest_prefooter') ? "checked" : ""; ?> /> <small>If you check this box, then the code from this area will not be displayed on non-front pages.</small> <br /><br /> <!-- ======== --> <label><span style="color:blue;"><b>Site Footer Area Code</b></span></label> <a href="#top_main">top</a><br/> This code will be inserted into the site footer area, right before the before the "Powered by" credits, but after any Footer widgets. This could include extra information, visit counters, etc. <br /> <textarea name="ttw_footer_opts" rows=3 style="width: 95%"><?php echo str_replace("\\", "", ttw_getopt('ttw_footer_opts')); ?> </textarea> <br /><br /> <!-- ======== --> <label><span style="color:blue;"><b>Post-Footer Code</b></span></label> <a href="#top_main">top</a><br/> This code will be inserted right after the footer area (between the "footer" and the "wrapper" /div tags). <br /> <textarea name="ttw_postfooter_insert" rows=3 style="width: 95%"><?php echo str_replace("\\", "", ttw_getopt('ttw_postfooter_insert')); ?> </textarea> <br /> <label>Hide on front page: </label><input type="checkbox" name="ttw_hide_front_postfooter" id="ttw_hide_front_postfooter" <?php echo ttw_getopt('ttw_hide_front_postfooter') ? "checked" : ""; ?> /> <small>If you check this box, then the code from this area will not be displayed on the front (home) page.</small><br /> <label>Hide on non-front pages: </label><input type="checkbox" name="ttw_hide_rest_postfooter" id="ttw_hide_rest_postfoter" <?php echo ttw_getopt('ttw_hide_rest_postfooter') ? "checked" : ""; ?> /> <small>If you check this box, then the code from this area will not be displayed on non-front pages.</small> <br /><br /> <!-- ======== --> <label><span style="color:blue;"><b>Pre-Sidebar Code</b></span></label> <a href="#top_main">top</a><br/> This code will be inserted right above the first sidebar area. <small>(Note: some HTML elements may require using 'style="display:inline"' to avoid display over entire page width. This also doesn't work well with the "Two, left and right sides" sidebar arrangement.)</small> <br /> <textarea name="ttw_presidebar_insert" rows=3 style="width: 95%"><?php echo str_replace("\\", "", ttw_getopt('ttw_presidebar_insert')); ?> </textarea> <br /> <label>Hide on front page: </label><input type="checkbox" name="ttw_hide_front_presidebar" id="ttw_hide_front_presidebar" <?php echo ttw_getopt('ttw_hide_front_presidebar') ? "checked" : ""; ?> /> <small>If you check this box, then the code from this area will not be displayed on the front (home) page.</small><br /> <label>Hide on non-front pages: </label><input type="checkbox" name="ttw_hide_rest_presidebar" id="ttw_hide_rest_presidebar" <?php echo ttw_getopt('ttw_hide_rest_presidebar') ? "checked" : ""; ?> /> <small>If you check this box, then the code from this area will not be displayed on non-front pages.</small> <br /><br /> <!-- ================================================================= --> <input type="submit" name="saveadvanced" value="Update Advanced Options" class="button-primary" /><br /> <hr /> <label><span style="color:#a44; font-weight:bold; font-size: larger;">Custom Page Template Options</span></label><br /> <small>Weaver includes several page templates. Some have extra options here. * The <em>2 Col Content</em> template splits content into two columns. you manually set the column split using the standard WP '<--more-->' convention. Columns will split first horizontally, then vertically (you can have more than one <--more--> tag). * The <em>Alternative Sidebar</em> templates have a single, fixed width sidebar that uses only the <em>Alternative Widget Area</em>. * The <em>One column, no sidebar</em> template produces a single content column with no sidebars. * The other templates are explained below.</small><br /><br /> <label><span style="color:#bb2222;"><b>"Custom Header Page Template" Code and Options</b></span></label> <a href="#top_main">top</a><br/> <small>This block functions exactly the same as <strong>Site Header Insert Code</strong> when used with pages created with the <em>Custom Header (see Adv Opts admin)</em> page template. The template creates pages that use only this code to display a header (they don't use the standard site header image), plus the options below.</small> <br /> <textarea name="ttw_custom_header_insert" rows=2 style="width: 95%"><?php echo str_replace("\\", "", ttw_getopt('ttw_custom_header_insert')); ?> </textarea> <br /> <label>Hide Menus on Custom Header pages: </label><input type="checkbox" name="ttw_hide_custom_header_template_menus" id="ttw_hide_custom_header_template_menus" <?php echo ttw_getopt('ttw_hide_custom_header_template_menus') ? "checked" : ""; ?> /> <small>If you check this box, then pages created using the <em>Custom Header</em> template will not display the standard menus.</small> <br /> <label>Hide Site Title/Description on Custom Header pages: </label> <input type="checkbox" name="ttw_hide_custom_header_template_siteinfo" id="ttw_hide_custom_header_template_siteinfo" <?php echo ttw_getopt('ttw_hide_custom_header_template_siteinfo') ? "checked" : ""; ?> /> <small>If you check this box, then pages created using the <em>Custom Header</em> template will not display the Site title or description.</small> <br /><br /> <!-- ======== --> <label><span style="color:#bb2222;"><b>"Blank Page Template" Options</b></span></label> <a href="#top_main">top</a><br/> <small>The <em>Blank - (see Adv Opts admin)</em> page template will wrap the content of an associated page only with the '#wrapper' HTML div surrounding the optional #header and #footer divs, and the #main div for the actual content. ('<div id="wrapper"><div id="header">header</div><div id="main">Content of page</div><div id="footer">footer</div>'). It does not include the page's title or other info. You will probably want to wrap your content in its own div with styling defined by a class added to the <HEAD> Section. The following options allow you to hide the header and footer from the page.</small> <br /> <label>Hide Header on Blank pages: </label><input type="checkbox" name="ttw_hide_blank_header" id="ttw_hide_blank_header" <?php echo ttw_getopt('ttw_hide_blank_header') ? "checked" : ""; ?> /> <small>If you check this box, then pages created using the <em>Blank</em> template will not display the standard header, including the image and menus.</small> <br /> <label>Hide Footer on Blank pages: </label> <input type="checkbox" name="ttw_hide_blank_footer" id="ttw_hide_blank_footer" <?php echo ttw_getopt('ttw_hide_blank_footer') ? "checked" : ""; ?> /> <small>If you check this box, then pages created using the <em>Blank</em> template will not display the standard footer area.</small> <br /><br /> <!-- ======== --> <label><span style="color:#8888FF;"><b>Predefined Theme CSS Rules</b></span></label> <a href="#top_main">top</a><br/> <small>Beginning with Weaver Version 1.5, this area is essentially unnecessary. If a predefined theme requires some CSS that can't be applied with a Main Options CSS rule, then that CSS will appear here. You may edit it if needed to make your own theme work. If you are defining a theme you want to share, you should move any definitions from the <HEAD> Section to here for your final version. That will leave the <HEAD> Section empty for others to add more customizations. This code is included before the <HEAD> Section code in the final HTML output file.</small> <br /> <textarea name="ttw_theme_head_opts" rows=2 style="width: 95%"><?php echo str_replace("\\", "", ttw_getopt('ttw_theme_head_opts')); ?> </textarea> <!-- ===================================================== --> <hr /> <label><span style="color:#4444CC; font-weight:bold; font-size: larger;">Site Options</span></label><br /> The following options are related to the current site. There are also some administrative options. These options are <strong>not</strong> considered to be a part of the theme, and are not saved in the theme settings file when you save a theme. These options are saved in the WP database, and will survive an upgrade to a new Weaver version. (The settings above this section are all saved when you save your theme settings.) <hr /> <label><span style="color:#4444CC;"><b>SEO Tags</b></span></label> <a href="#top_main">top</a><br/> <small>Every site should have at least "description" and "keywords" meta tags for basic SEO (Search Engine Optimization) support. Please edit these tags to provide more information about your site, which is inserted into the <HEAD> section of your site. You might want to check out other WordPress SEO plugins if you need more advanced SEO. Note that this information is not part of your theme settings, and will not be included when you save or restore your theme.</small> <br /> <textarea name="ttw_metainfo" rows=2 style="width: 95%"><?php echo str_replace("\\", "", ttw_getadminopt('ttw_metainfo')); ?> </textarea> <br> <label>Don't add SEO meta tags: </label><input type="checkbox" name='ttw_hide_metainfo' id='ttw_hide_metainfo' <?php echo ttw_getadminopt('ttw_hide_metainfo') ? "checked" : ""; ?> /> <small>If you check this box, then this meta information will not be added to your site. You might want to check this box if you are using more advanced WordPress SEO plugins.</small> <br /><br /> <!-- ======== --> <label><span style="color:#4444CC;"><b>Site Copyright</b></span></label> <a href="#top_main">top</a><br/> <small>If you fill this in, the default copyright notice in the footer will be replaced with the text here. It will not automatically update from year to year. Use &copy; to display ©. You can use other HTML as well.</small> <br /> <textarea name="ttw_copyright" rows=1 style="width: 95%"><?php echo str_replace("\\", "", ttw_getadminopt('ttw_copyright')); ?> </textarea> <br> <label>Hide Powered By tag: </label><input type="checkbox" name='ttw_hide_poweredby' id='ttw_hide_poweredby' <?php echo ttw_getadminopt('ttw_hide_poweredby') ? "checked" : ""; ?> /> <small>Check this to hide the "Proudly powered by" notice in the footer.</small> <br /><br /> <!-- ======== --> <label><span style="color:#4444CC;"><b>The Last Thing</b></span></label> <a href="#top_main">top</a><br/> <small>This code is inserted right before the closing </body> tag. Some outside sites may provide you with JavaScript code that should be put here. (Note that this information is not part of your theme settings, and will not be included when you save or restore your theme.)</small> <br /> <textarea name="ttw_end_opts" rows=1 style="width: 95%"><?php echo str_replace("\\", "", ttw_getadminopt('ttw_end_opts')); ?> </textarea> <br /><br /> <hr /> <label><span style="color:green;"><b>Administrative Options</b></span></label> <a href="#top_main">top</a><br/> These options control some administrative options and appearance features. <br /><br /> <label>Hide Site Preview: </label><input type="checkbox" name="ttw_hide_preview" id="ttw_hide_preview" <?php echo ttw_getadminopt('ttw_hide_preview') ? "checked" : ""; ?> /> <small>Checking this box will hide the Site Preview at the bottom of the screen which might speed up response a bit.</small><br /> <label>Hide Theme Thumbnails: </label> <input type="checkbox" name="ttw_hide_theme_thumbs" id="ttw_hide_theme_thumbs" <?php echo ttw_getadminopt('ttw_hide_theme_thumbs') ? "checked" : ""; ?> /> <small>Checking this box will hide the Sub-theme preview thumbnails on the Weaver Themes tab which might speed up response a bit.</small><br /> <label>Don't auto-display CSS rules: </label> <input type="checkbox" name="ttw_hide_auto_css_rules" id="ttw_hide_auto_css_rules" <?php echo ttw_getadminopt('ttw_hide_auto_css_rules') ? "checked" : ""; ?> /> <small>Checking this box will disable the auto-display of Main Option elements that have CSS settings.</small><br /> <label>Hide old IE version warning: </label> <input type="checkbox" name="ttw_hide_IE_warning_css" id="ttw_hide_IE_warning_css" <?php echo ttw_getadminopt('ttw_hide_IE_warning_css') ? "checked" : ""; ?> /> <small>Check this box to hide the warning Weaver automatically displays when the visitor is using IE 7 or earlier.</small><br /> <label>Use Inline CSS: </label> <input type="checkbox" name="ttw_force_inline_css" id="ttw_force_inline_css" <?php echo ttw_getadminopt('ttw_force_inline_css') ? "checked" : ""; ?> /> <small>Checking this box will have Weaver generate CSS inline rather than use the style-weaver.css external style sheet.</small><br /> </fieldset> <br /><input type="submit" name="saveadvanced" value="Update Advanced Options" class="button-primary" /><br /><br /> <?php ttw_nonce_field('saveadvanced'); ?> </form> <hr /> <form name="ttw_resetweaver_form" method="post" onSubmit="return confirm('Are you sure you want to reset all Weaver settings?');"> <strong>Click the Clear button to reset all Weaver settings to the default values.</strong><br > <em>Warning: You will lose all current settings.</em> You should use the Save/Restore tab to save a copy of your current settings before clearing! <span class="submit"><input type="submit" name="reset_weaver" value="Clear All Weaver Settings"/></submit> <?php ttw_nonce_field('reset_weaver'); ?> </form> </div> <hr /> <?php }
_e('Skip to content', TTW_TRANS); ?> </a></div> <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?> <?php wp_nav_menu(array('container_class' => 'menu-header', 'theme_location' => 'primary')); ?> </div><!-- #access --> <?php } ?> <?php if (!ttw_getopt('ttw_hide_menu') && ttw_getopt('ttw_move_menu')) { /* ttw - move header */ ?> <div id="access2" role="navigation"> <div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e('Skip to content', TTW_TRANS); ?> "><?php _e('Skip to content', TTW_TRANS); ?> </a></div> <?php wp_nav_menu(array('container_class' => 'menu-header', 'theme_location' => 'secondary', 'fallback_cb' => '')); ?> </div><!-- #access2 --> <?php
function ttw_sidebar_css($sout) { /* output the CSS to support different sidebars at different widths */ $sidebars = ttw_getopt('ttw_sidebars'); $themewidth = ttw_getopt('ttw_header_image_width'); if (!$themewidth) { $themewidth = '940'; } $sidebarwidth = ttw_getopt('ttw_sidebar_width'); $sb_adjust = (int) ttw_getopt('ttw_border_adjust_sidebar'); /* SIDEBAR layout - need to calculate and override items if change width. * First, calculate and emit everything that is constant for each alternative: * Footer width, site-info, site-generator, site-title, site-description. */ $mw = (int) $themewidth; /* main width */ $fw = (int) (($mw + 20) / 4 - 25); /* footer width ((mainwidth+20)/4)-25 */ $si = (int) (($mw - 40) * 0.5); /* site info = 60% of mainwidth-40*/ $sg = (int) ($mw - 50 - $si); /* site generator - left over space */ $caw = (int) $mw - 40; /* mainwidth - 40 */ $ocw = (int) ($mw * 0.9); /* one column width */ $tbmult = 0.85; // usually make top/bottom widget areas 85% if (ttw_getopt('ttw_wide_top_bottom')) { $tbmult = 1; } if ($mw != WVR_WIDTH) { /* non-default width means override footer, etc. */ fwrite($sout, sprintf("#access .menu-header, #access2 .menu-header, div.menu, #colophon, #branding, #main, #wrapper { width: %dpx; }\n", $mw)); fwrite($sout, sprintf("#footer-widget-area .widget-area {width: %dpx; }\n", $fw)); fwrite($sout, sprintf("#site-info { width: %dpx;}\n", $si)); fwrite($sout, sprintf("#site-generator {text-align:right; width: %dpx; }\n", $sg)); fwrite($sout, sprintf("#site-title {width: 55%%;} ")); fwrite($sout, sprintf("#site-description {text-align:right; padding-right: 20px; width: 40%%;}\n")); fwrite($sout, sprintf("#access, #access2 {width: %dpx; }\n", $mw)); fwrite($sout, sprintf("#access .menu-header, #access2 .menu-header, div.menu {width: %dpx;}\n", $mw - 12)); fwrite($sout, sprintf("#content .attachment img {max-width: %dpx;}\n", $caw)); fwrite($sout, sprintf(".single-attachment #content {width: %dpx;}\n", $caw)); fwrite($sout, sprintf(".one-column #content {margin-left: %dpx; padding: 0; width: %dpx;}\n", (int) ($mw * 0.05), $ocw)); fwrite($sout, sprintf("#main {margin-bottom:4px;}\n")); $altcontainer = $mw - 240; // alt templates fwrite($sout, sprintf(".right-alt #container {width: %dpx;}\n.right-alt #content {width: %dpx;}\n.right-alt #content img {max-width: %dpx;}\n", $altcontainer, $altcontainer - 20, $altcontainer - 30)); fwrite($sout, sprintf(".left-alt #content {width: %dpx;}\n.left-alt #contentl img {max-width: %dpx;}", $altcontainer - 42, $altcontainer - 50)); } if ($sidebars == SB_none) { /* no sidebars - simply hide them */ if ($themewidth != WVR_WIDTH || $sidebarwidth || $tbmult == 1) { $sidebarwidth = 0; /* use default if not set */ /* contentwidth + primary_secondary_width == (mainwidth-50) */ $contentw = (int) ($mw - 50 - $sidebarwidth); /* from formula */ $containerw = (int) ($contentw + 38); /* contentwidth + 38 */ if (ttw_getopt('ttw_wide_top_bottom')) { $ttwwid = $contentw; } else { $ttwwid = (int) ($contentw - 70); } /* contentwidth - 70 */ fwrite($sout, sprintf("#container { float: left; margin: 0 0px 4px 0; width: %dpx; }\n", $containerw)); fwrite($sout, sprintf("#content {width: %dpx; overflow:hidden; margin:0 0px 10px 0px; padding: 5px 0px 0px 20px;}\n", $contentw)); fwrite($sout, sprintf("#content img { max-width: %dpx;}\n", $contentw)); fwrite($sout, sprintf("#primary, #secondary { visibility:hidden; width:0px; height: 0px;}\n")); if (ttw_getopt('ttw_wide_top_bottom')) { fwrite($sout, sprintf("#ttw-top-widget, #ttw-bot-widget {width: %dpx; margin-left: 20px;}\n", $ttwwid)); } else { fwrite($sout, sprintf("#ttw-top-widget, #ttw-bot-widget {width: %dpx;}\n", $ttwwid)); } } else { /* using defaults, so make shorter */ fwrite($sout, sprintf("#container { width:940px; margin: 0px 0px -30px 0px; }\n#content { width: 860px; margin: 0 100px 30px 0px; overflow:hidden; padding-top: 10px;}\n#content img { max-width: 860px;}\n#primary { visibility:hidden; width:0px; height: 0px;}\n#secondary { visibility:hidden; width:0px; height: 0px;}\n#ttw-top-widget, #ttw-bot-widget {width: 800px;}\n.one-column #content { margin: 0 0 0 80px; padding: 0; width: 860px;}\n")); } } elseif ($sidebars == SB_2c) { /* 2 sidebars, main central column */ if ($themewidth != WVR_WIDTH || $sidebarwidth || $tbmult == 1 || $sb_adjust != 0) { if (!$sidebarwidth) { $sidebarwidth = 220; } /* use default if not set */ /* contentwidth = mainwidth - 40 - (2*sidebarwidth ) */ $contentw = (int) ($mw - 40 - $sidebarwidth * 2); /* from formula */ $containerw = (int) $mw; /* same a mw */ $ttwwid = (int) ($contentw * $tbmult); /* 85% or 100% */ if ($tbmult == 1) { $ttwmargin = $sidebarwidth + 20; $ttwwid -= 10; } else { $ttwmargin = (int) ($sidebarwidth + $contentw * 0.115); } if (ttw_getopt('ttw_useborders')) { $second_left = (int) $sidebarwidth + 6; } else { $second_left = (int) $sidebarwidth + 4; } fwrite($sout, sprintf("#container { width:%dpx; float:left; margin:0 0 4px 0px;}\n", $containerw)); fwrite($sout, sprintf("#content { width: %dpx; margin: 0px 0px 5px %dpx; overflow:hidden; padding: 5px 20px 4px 20px; }\n", $contentw, $sidebarwidth)); fwrite($sout, sprintf("#content img { max-width: %dpx;}\n", $contentw)); fwrite($sout, sprintf("#primary { width:%dpx; float:left; margin: 0 0 4px -%dpx; }\n", $sidebarwidth - 6 - $sb_adjust, $mw)); fwrite($sout, sprintf("#secondary { width:%dpx; float:left; margin: 0 0 4px -%dpx;}\n", $sidebarwidth - 6 - $sb_adjust, $second_left)); fwrite($sout, sprintf("#ttw-top-widget, #ttw-bot-widget {width: %dpx; margin-left: %dpx;}\n", $ttwwid, $ttwmargin)); } else { /* using defaults, so make shorter */ fwrite($sout, sprintf("#container { width:940px; float:left; margin:0 0 4px 0px; }\n#content { width: 460px; margin: 0px 0px 5px 220px; overflow:hidden; padding: 5px 20px 4px 20px; }\n#content img { max-width: 460px;}\n#primary { width:214px; float:left; margin: 0 0 4px -940px; }\n#secondary { width:214px; float:left; margin: 0 0 4px -226px;}\n#ttw-top-widget, #ttw-bot-widget {width: 400px; margin-left: 265px;}\n.one-column #content { margin: 0 0 0 0 px; padding: 0; width: 800px;}\n")); } } elseif ($sidebars == SB_2r) { if ($themewidth != WVR_WIDTH || $sidebarwidth || $tbmult == 1 || $sb_adjust != 0) { if (!$sidebarwidth) { $sidebarwidth = 220; } /* use default if not set */ $sb2 = (int) ($sidebarwidth * 0.75); $contentw = (int) ($mw - 60 - $sidebarwidth - $sb2); /* from formula */ if (ttw_getopt('ttw_useborders')) { $containerw = (int) ($contentw + 36); } else { $containerw = (int) ($contentw + 40); } $ttwwid = (int) ($contentw * $tbmult); if ($tbmult == 1) { $ttwmargin = 0; $ttwwid += 5; } else { $ttwmargin = (int) ($contentw * 0.115); } fwrite($sout, sprintf("#container { width:%dpx; float:left; margin:0 0px 4px 0px;}\n", $containerw)); fwrite($sout, sprintf("#content {width: %dpx; overflow:hidden; margin:0 0px 10px 0px; padding: 5px 0px 0px 20px;}\n", $contentw)); fwrite($sout, sprintf("#content img { max-width: %dpx;}\n", $contentw)); fwrite($sout, sprintf("#primary { width:%dpx; float:left; margin:0 0px 4px 0px;}\n", $sidebarwidth - $sb_adjust)); fwrite($sout, sprintf("#secondary { width:%dpx; float:left; margin:0 0 4px 0px;}\n", $sb2)); fwrite($sout, sprintf("#ttw-top-widget, #ttw-bot-widget {width: %dpx;margin-left:%dpx;}\n", $ttwwid, $ttwmargin)); } else { /* using defaults, so make shorter */ fwrite($sout, sprintf("#container { width:525px; float:left; margin:0 0px 4px 0px;}\n#content { width: 490px; overflow:hidden; margin:0 0px 10px 0px; padding: 5px 0px 0px 20px;}\n#content img { max-width: 490px;}\n#primary { width:220px; float:left; margin:0 0px 4px 0px;}\n#secondary { width:170px; float:left; margin:0 0 4px 0px;}\n#ttw-top-widget, #ttw-bot-widget {width: 420px; margin-left: 40px;}\n.one-column #content { margin: 0 0 0 80px; padding: 0; width: 800px;}\n")); } } elseif ($sidebars == SB_2l) { if ($themewidth != WVR_WIDTH || $sidebarwidth || $tbmult == 1 || $sb_adjust != 0) { if (!$sidebarwidth) { $sidebarwidth = 220; } /* use default if not set */ $sb2 = (int) ($sidebarwidth * 0.75); $contentw = (int) ($mw - 60 - $sidebarwidth - $sb2); /* from formula */ if (ttw_getopt('ttw_useborders')) { $containerw = (int) ($contentw + 36); } else { $containerw = (int) ($contentw + 40); } $ttwwid = (int) ($contentw * $tbmult); if ($tbmult == 1) { $ttwmargin = 18; } else { $ttwmargin = (int) ($contentw * 0.115); } fwrite($sout, sprintf("#container { width:%dpx; float:right; margin:0 0 4px 0px;}\n", $containerw)); fwrite($sout, sprintf("#content { width: %dpx; overflow:hidden; float:right; padding: 5px 10px 5px 0px; margin:0 10px 4px 0px;}\n", $contentw)); fwrite($sout, sprintf("#content img { max-width: %dpx;}\n", $contentw)); fwrite($sout, sprintf("#primary { width:%dpx; float:left; margin:0 0px 4px 0px;}\n", $sidebarwidth - 4 - $sb_adjust)); fwrite($sout, sprintf("#secondary { width:%dpx; float:left; margin:0 0 4px 0px; clear:none;}\n", $sb2)); fwrite($sout, sprintf("#ttw-top-widget, #ttw-bot-widget {width: %dpx;margin-left:%dpx;}\n", $ttwwid, $ttwmargin)); fwrite($sout, sprintf(".one-column #content { margin-right: %dpx;}\n", (int) ($mw * 0.05))); } else { /* using defaults, so make shorter */ fwrite($sout, sprintf("#container { width:530px; float:right; margin:0 0 4px 0px;}\n#content { width: 490px; overflow:hidden; float:right; padding: 5px 10px 5px 0px; margin:0 10px 4px 0px;}\n#content img { max-width: 490px;}\n#primary { width:216px; float:left; margin:0 0px 4px 0px;}\n#secondary { width:170px; float:left; margin:0 0 4px 0px; clear:none;}\n#ttw-top-widget, #ttw-bot-widget {width: 420px;}\n.one-column #content {margin: 0 60px 0 0px; padding: 0; width: 800px;}\n")); } } elseif ($sidebars == SB_1l) { if ($themewidth != WVR_WIDTH || $sidebarwidth || $tbmult == 1 || $sb_adjust != 0) { if (!$sidebarwidth) { $sidebarwidth = 220; } /* use default if not set */ $contentw = (int) ($mw - 70 - $sidebarwidth); /* from formula */ $ttwwid = (int) ($contentw * $tbmult); if ($tbmult == 1) { $ttwmargin = 30; } else { $ttwmargin = (int) ($contentw * 0.115); } fwrite($sout, sprintf("#container { float: right; margin: 0 -%dpx 4px 0; width: 100%%;}\n", $sidebarwidth + 20)); fwrite($sout, sprintf("#content { margin: 0px %dpx 4px 0px; width: %dpx; padding: 10px 25px 5px 25px;}\n", $sidebarwidth + 20, $contentw)); fwrite($sout, sprintf("#content img { max-width: %dpx;}\n", $contentw)); fwrite($sout, sprintf("#container.one-column-iframe #content {margin:0 0 0 -%dpx;padding:0px;width:100%%;}\n", $sidebarwidth + 20)); fwrite($sout, sprintf("#primary, #secondary { float: left; width: %dpx; padding-left: 15px; margin-bottom:4px;}\n", $sidebarwidth + 3 - $sb_adjust)); fwrite($sout, sprintf("#secondary { clear: left; }\n")); fwrite($sout, sprintf("#ttw-top-widget, #ttw-bot-widget {width: %dpx; margin-left: %dpx;}\n", $ttwwid, $ttwmargin)); fwrite($sout, sprintf(".one-column #content { margin-left: %dpx;}\n", (int) ($mw * 0.05 - $sidebarwidth - 20))); } else { /* using defaults, so make shorter */ fwrite($sout, sprintf("#container { float: right; margin: 0 -240px 4px 0; width: 100%%;}\n#content { margin: 0px 240px 4px 0px; width: 640px; padding: 10px 25px 5px 25px;}\n#container.one-column-iframe #content {margin:0 0 0 -240px;padding:0;width:100%%;}\n#content img { max-width: 640px;}\n#primary, #secondary { float: left; width: 223px; padding-left: 15px; margin-bottom:4px;}\n#secondary { clear: left;}\n#ttw-top-widget, #ttw-bot-widget {width: 580px;}\n.one-column #content { margin: 0 0 0 -160px; padding: 0; width: 800px;}\n")); } } elseif ($sidebars == SB_1rw) { if ($themewidth != WVR_WIDTH || $sidebarwidth || $tbmult == 1 || $sb_adjust != 0) { if (!$sidebarwidth) { $sidebarwidth = 300; } /* use default if not set */ /* contentwidth + primary_secondary_width == (mainwidth-50) */ $contentw = (int) ($mw - 50 - $sidebarwidth); /* from formula */ $containerw = (int) ($contentw + 38); /* contentwidth + 38 */ $ttwwid = (int) ($contentw - 70); /* contentwidth - 70 */ if ($tbmult == 1) { $ttwwid = $contentw; } fwrite($sout, sprintf("#container { float: left; margin: 0 0px 4px 0; width: %dpx; }\n", $containerw)); fwrite($sout, sprintf("#content {width: %dpx; overflow:hidden; margin:0 0px 10px 0px; padding: 5px 0px 0px 20px;}\n", $contentw)); fwrite($sout, sprintf("#content img { max-width: %dpx;}\n", $contentw)); fwrite($sout, sprintf("#primary, #secondary { float: right; overflow: hidden; width: %dpx; margin: 0 0 4px 0;}\n", $sidebarwidth - $sb_adjust)); if ($tbmult == 1) { fwrite($sout, sprintf("#ttw-top-widget, #ttw-bot-widget {width: %dpx; margin-left: 1px; margin-right: 1px;}\n", $ttwwid)); } else { fwrite($sout, sprintf("#ttw-top-widget, #ttw-bot-widget {width: %dpx;}\n", $ttwwid)); } } else { /* using defaults, so make shorter */ fwrite($sout, sprintf("#main {margin-bottom:4px;}\n#container { float: left; margin: 0 0px 4px 0; width: 628px; }\n#content {width: 590px; overflow:hidden; margin:0 0px 10px 0px; padding: 5px 0px 0px 20px;}\n#content img { max-width: 590px;}\n#primary, #secondary { float: right; overflow: hidden; width: 300px; margin: 0 0 4px 0;}\n#ttw-top-widget, #ttw-bot-widget {width: 520px;}\n.one-column #content { margin: 0 0 0 80px; padding: 0; width: 800px;}\n")); } } else { /* default right sidebar */ if ($themewidth != WVR_WIDTH || $sidebarwidth || $tbmult == 1 || $sb_adjust != 0) { if (!$sidebarwidth) { $sidebarwidth = 220; } /* use default if not set */ /* contentwidth + primary_secondary_width == (mainwidth-50) */ $contentw = (int) ($mw - 50 - $sidebarwidth); /* from formula */ $containerw = (int) ($contentw + 38); /* contentwidth + 38 */ $ttwwid = (int) ($contentw - 70); /* contentwidth - 70 */ if ($tbmult == 1) { $ttwwid = $contentw; } fwrite($sout, sprintf("#container { float: left; margin: 0 0px 4px 0; width: %dpx; }\n", $containerw)); fwrite($sout, sprintf("#content {width: %dpx; overflow:hidden; margin:0 0px 10px 0px; padding: 5px 0px 0px 20px;}\n", $contentw)); fwrite($sout, sprintf("#content img { max-width: %dpx;}\n", $contentw)); fwrite($sout, sprintf("#primary, #secondary { float: right; overflow: hidden; width: %dpx; margin: 0 0 4px 0;}\n", $sidebarwidth - $sb_adjust)); if ($tbmult == 1) { fwrite($sout, sprintf("#ttw-top-widget, #ttw-bot-widget {width: %dpx; margin-left: 1px; margin-right: 1px;}\n", $ttwwid)); } else { fwrite($sout, sprintf("#ttw-top-widget, #ttw-bot-widget {width: %dpx;}\n", $ttwwid)); } } } }
"><?php _e('Skip to content', TTW_TRANS); ?> </a></div> <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?> <?php wp_nav_menu(array('container_class' => 'menu-header', 'theme_location' => 'primary')); ?> </div><!-- #access --> <?php } ?> <?php if (!ttw_getopt('ttw_hide_custom_header_template_menus') && ttw_getopt('ttw_move_menu')) { /* ttw - move header */ ?> <div id="access2" role="navigation"> <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?> <div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e('Skip to content', TTW_TRANS); ?> "><?php _e('Skip to content', TTW_TRANS); ?> </a></div> <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */
function ttw_the_content_featured_single() { if (ttw_getopt('ttw_show_featured_image_fullposts')) { ?> <a href="<?php the_permalink(); ?> " title="<?php printf(esc_attr__('Permalink to %s', TTW_TRANS), the_title_attribute('echo=0')); ?> " rel="bookmark"><?php the_post_thumbnail('thumbnail-single'); ?> </a> <?php } the_content(); }
function ttw_write_current_theme($savefile) { // write the current theme to file, return true or false global $ttw_optionsList; ttw_saveopts(); // let's save it in case the user forgot (saves everything) $wpdir = wp_upload_dir(); // get the upload directory $save_dir = $wpdir['basedir'] . '/weaver-subthemes'; $save_url = $wpdir['baseurl'] . '/weaver-subthemes'; $usename = strtolower(sanitize_file_name($savefile)); $usename = str_replace('.wvr', '', $usename); if (strlen($usename) < 1) { return ''; } $usename = $usename . '.wvr'; $ttw_theme_dir_exists = wp_mkdir_p($save_dir); $ttw_theme_dir_writable = $ttw_theme_dir_exists; if (!$ttw_theme_dir_exists) { // it either already exisits, or was created echo '<div class="error"><p>'; echo 'It looks like <strong>' . $save_dir . '</strong> does not exist.<br /><br /> You will need to create this writeable directory in order to save sub-themes on your site.<br /><br />Maybe <a href="http://codex.wordpress.org/Changing_File_Permissions" target="_blank">This Article</a> from WordPress will help.'; echo '</p></div><br />'; } else { if (!is_writable($save_dir)) { if (!is_writable($save_dir)) { echo '<div class="error"><p>'; echo 'It looks like <strong>' . $save_dir . '</strong> is not writable.<br /><br /> You will need to directory writable in order to save sub-themes on your site.<br /><br />Maybe <a href="http://codex.wordpress.org/Changing_File_Permissions" target="_blank">This Article</a> from WordPress will help.'; echo '</p></div><br />'; $ttw_theme_dir_writable = false; } } } if (!$ttw_theme_dir_writable) { return ''; } $filename = $save_dir . '/' . $usename; // we will add txt if (!($handle = fopen($filename, 'w'))) { ?> <h4>Sorry, something went wrong.</h4> <p>We were unable to create the temporary file to save the theme on the server. It is likely some kind of server file permission problem.</p> <?php return ''; } fwrite($handle, "TTW-V01.10"); /* 10 byte header */ /* copy all current settings to the $ttw_optionsList array so we can serialize it */ foreach ($ttw_optionsList as $key => $val) { $curVal = ttw_getopt($key); $ttw_optionsList[$key] = $curVal; } /* ok, write that sucker out! */ $tosave = serialize($ttw_optionsList); fwrite($handle, $tosave); fclose($handle); return $save_url . '/' . $usename; }