Forum

Autofocus+ Theme Custom Field hinzufügen

Erstellt von floei, 25.01.2011.



  1. floei

    floei freundlicher Helfer

    Dabei seit:
    22.03.2008
    Beiträge:
    714
    Geschlecht:
    männlich
    Ort:
    Stuttgart
    Software:
    CS4 Production Premium,Cinema4D
    Kameratyp:
    Canon EOS 500D
    Autofocus+ Theme Custom Field hinzufügen
    Nochmal eine Frage:
    Wie füge Ich denn im Autofocus+ Theme (Thematic Childtheme) Custom Fields hinzu? Weil mit den Tutorials von Wodpress bekomme Ich das nicht hin. Es soll einfach 3 Felder geben, bei denen ich eintragen kann welche Software genutzt wurde was mein Anteil war und welcher Client, am besten direkt unter das Video, das übrigens auch über ein custom field eingebunden wird!

    Functions.php kannunten eingesehen werden, falls noch etwas benötigt wird stelle ich es gerne zur verfügung!

    Hier der LINK zum Portfolio

    Gruß Flo

    Theme-Functions:
    PHP:
    1. <?php
    2.  
    3. //    Conditional test for IE6
    4. function browser_ie6() {
    5.     $agents = array(
    6.         'MSIE 6.0'
    7.     );
    8.     foreach ($agents as $agent) {
    9.         if (strpos($_SERVER['HTTP_USER_AGENT'], $agent) or isset($_GET[$agent]) && $_GET[$agent] ) {
    10.             return true;
    11.         }
    12.     }
    13.   return false;
    14. }
    15.  
    16. //    Thanks very much to Thin & Light (http://thinlight.org/) for this custom function!
    17. function tl_excerpt($text, $excerpt_length = 25) {
    18.     $text = str_replace(']]>', ']]&gt;', $text);
    19.     $text = strip_tags($text);
    20.     $text = preg_replace("/\[.*?]/", "", $text);
    21.     $words = explode(' ', $text, $excerpt_length + 1);
    22.     if (count($words) > $excerpt_length) {
    23.         array_pop($words);
    24.         array_push($words, '...');
    25.         $text = implode(' ', $words);
    26.     }
    27.    
    28.     return apply_filters('the_excerpt', $text);
    29. }
    30.  
    31. function tl_post_excerpt($post) {
    32.     $excerpt = ($post->post_excerpt == '') ? (tl_excerpt($post->post_content))
    33.             : (apply_filters('the_excerpt', $post->post_excerpt));
    34.     return $excerpt;
    35. }
    36.  
    37. function previous_post_excerpt($in_same_cat = false, $excluded_categories = '') {
    38.     if ( is_attachment() )
    39.         $post = &get_post($GLOBALS['post']->post_parent);
    40.     else
    41.         $post = get_previous_post($in_same_cat, $excluded_categories);
    42.  
    43.     if ( !$post )
    44.         return;
    45.     $post = &get_post($post->ID);
    46.     echo tl_post_excerpt($post);
    47. }
    48.  
    49. function next_post_excerpt($in_same_cat = false, $excluded_categories = '') {
    50.     $post = get_next_post($in_same_cat, $excluded_categories);
    51.  
    52.     if ( !$post )
    53.         return;
    54.     $post = &get_post($post->ID);
    55.     echo tl_post_excerpt($post);
    56. }
    57.  
    58. // Photo Author/Credit Display
    59. function autofocus_credit() {
    60.     global $post;
    61.        
    62.     if ( get_the_author_meta('user_url') == '' ) { ?>
    63.         <span class="photo-credit">&copy; <?php the_time('Y'); ?> <?php the_author_meta('display_name'); ?>. <?php _e('All rights reserved.', 'thematic'); ?></span>
    64.     <?php } else { ?>
    65.         <span class="photo-credit">&copy; <?php the_time('Y'); ?> <a href="<?php the_author_meta('user_url'); ?>" target="_blank" rel="author"><?php the_author_meta('display_name'); ?></a>. <?php _e('All rights reserved.', 'thematic'); ?></span>
    66.     <?php } ?>
    67.  
    68. <?php }
    69.  
    70. //    Post Attachment image function. Direct link to file.
    71. function the_post_image($size=large, $fullsize=false, $width=940, $height=600, $max_dims=false) {
    72.    
    73.     global $post;
    74.     $linkedimgtag = get_post_meta ($post->ID, 'image_tag', true);
    75.    
    76.     if ( $images = get_children(array(
    77.         'post_parent' => get_the_ID(),
    78.         'post_type' => 'attachment',
    79.         'numberposts' => 1,
    80.         'post_mime_type' => 'image',)))
    81.         {
    82.         foreach( $images as $image ) {
    83.             $attachmenturl=wp_get_attachment_url($image->ID);
    84.             $attachmentimage=wp_get_attachment_image( $image->ID, $size );
    85.             $attachmentresize=get_attachment_innerHTML($image->ID, $fullsize, array($width, $height));
    86.  
    87.             echo $attachmentimage;
    88.         }
    89.        
    90.     } elseif ( $linkedimgtag ) {
    91.  
    92.         echo $linkedimgtag;
    93.  
    94.     } elseif ( $linkedimgtag && $images = get_children(array(
    95.         'post_parent' => get_the_ID(),
    96.         'post_type' => 'attachment',
    97.         'numberposts' => 1,
    98.         'post_mime_type' => 'image',)))
    99.         {
    100.         foreach( $images as $image ) {
    101.             $attachmenturl=wp_get_attachment_url($image->ID);
    102.             $attachmentimage=wp_get_attachment_image( $image->ID, $size );
    103.             $attachmentresize=get_attachment_innerHTML($image->ID, $size, array($width, $height));
    104.  
    105.             echo $attachmentresize;
    106.         }
    107.        
    108.     } elseif (get_post_meta($post->ID, 'image_tag', $single = true) == "" && is_single()) {
    109.         // Don’t show anything on Single pages that don’t have Image or Video attachments.
    110.  
    111.     } else {
    112.         echo '<!-- No Image Attached! -->';
    113.         echo '<img src="';
    114.         echo get_bloginfo ( 'stylesheet_directory' ) . '/img/no-attachment.png';
    115.         echo '" width="188" height="188" />';
    116.     }
    117. }
    118.  
    119. //    Setup Images for Attachment functions
    120. function image_setup($postid) {
    121.     global $post;
    122.     $post = get_post($postid);
    123.  
    124.     //    get url
    125.     if ( !preg_match('/<img ([^>]*)src=(\"|\')(.+?)(\2)([^>\/]*)\/*>/', $post->post_content, $matches) ) {
    126.         return false;
    127.     }
    128.  
    129.     //    url setup /**/
    130.     $post->image_url = $matches[3];
    131.     if ( !$post->image_url = preg_replace('/\?w\=[0-9]+/','', $post->image_url) )
    132.         return false;
    133.  
    134.     $post->image_url = clean_url( $post->image_url, 'raw' );
    135.    
    136.     delete_post_meta($post->ID, 'image_url');
    137.     delete_post_meta($post->ID, 'image_tag');
    138.  
    139.     add_post_meta($post->ID, 'image_url', $post->image_url);
    140.     add_post_meta($post->ID, 'image_tag', '<img src="'.$post->image_url.'" />');
    141. }
    142. add_action('publish_post', image_setup);
    143. add_action('publish_page', image_setup);
    144.  
    145. //    Post Attachment image function for Attachment Pages.
    146. function the_attachment_image($size=large) {
    147.     $attachmenturl=wp_get_attachment_url($image->ID);
    148.     $attachmentimage=wp_get_attachment_image( $image->ID, $size );
    149.  
    150.     echo ''.$attachmentimage.'';
    151. }
    152.  
    153. //    Grab EXIF Data from Attachments
    154. //    http://www.bloggingtips.com/2008/07/20/wordpress-gallery-and-exif/
    155. function grab_exif_data() {
    156.     global $id, $post;
    157.     $imgmeta = wp_get_attachment_metadata($id, false);
    158.  
    159.     //    Start to display EXIF and IPTC data of digital photograph
    160.     echo "<h3 id='exif-data'>Exif Data</h3>";
    161.     echo "<ul><li><span class=\"exif-title\">Date Taken:</span> " . date("d-M-Y H:i:s", $imgmeta['image_meta']['created_timestamp'])."</li>";
    162.     echo "<li><span class=\"exif-title\">Copyright:</span> " . $imgmeta['image_meta']['copyright']."</li>";
    163.     echo "<li><span class=\"exif-title\">Credit:</span> " . $imgmeta['image_meta']['credit']."</li>";
    164.     echo "<li><span class=\"exif-title\">Title:</span> " . $imgmeta['image_meta']['title']."</li>";
    165.     echo "<li><span class=\"exif-title\">Caption:</span> " . $imgmeta['image_meta']['caption']."</li>";
    166.     echo "<li><span class=\"exif-title\">Camera:</span> " . $imgmeta['image_meta']['camera']."</li>";
    167.     echo "<li><span class=\"exif-title\">Focal Length:</span> " . $imgmeta['image_meta']['focal_length']."mm</li>";
    168.     echo "<li><span class=\"exif-title\">Aperture:</span> f/" . $imgmeta['image_meta']['aperture']."</li>";
    169.     echo "<li><span class=\"exif-title\">ISO:</span> " . $imgmeta['image_meta']['iso']."</li>";
    170.     echo "<li><span class=\"exif-title\">Shutter Speed:</span> " . number_format($imgmeta['image_meta']['shutter_speed'], 2)." seconds</li>\n</ul>";
    171. }
    172.  
    173. //    Get the Post Thumbnail URL for the EXIF link
    174. function exif_link( $post_id = NULL, $size = 'single-post-thumbnail', $attr = '' ) {
    175.     global $id;
    176.     $post_id = ( NULL === $post_id ) ? $id : $post_id;
    177.     $post_thumbnail_id = get_post_thumbnail_id( $post_id );
    178.     $size = apply_filters( 'single-post-thumbnail', $size );
    179.     if ( $post_thumbnail_id ) {
    180.         $thumburl = get_attachment_link( $post_thumbnail_id, $size, false, $attr );
    181.     } else {
    182.         $thumburl = '';
    183.     }
    184.     return $thumburl;
    185. }
    186.  
    187. //    Add Images/Video/Embeds to feeds
    188. //    - Based on the Custom Fields for Feeds Plugin by Justin Tadlock
    189. //    - http://justintadlock.com/archives/2008/01/27/custom-fields-for-feeds-wordpress-plugin
    190. function autofocus_feed( $content ) {
    191.     global $post, $id, $afoptions;
    192.     foreach ($afoptions as $value) {
    193.         if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }
    194.     }
    195.    
    196.     $data = get_post_meta( $post->ID, 'autofocus', true );
    197.     $blog_key = substr( md5( get_bloginfo('url') ), 0, 16 );
    198.    
    199.     if ( !is_feed() ) return $content;
    200.  
    201. //    Is there a Video attached?
    202. //    - WordPress doesn’t setup [embed] codes as shortcodes.
    203. //    - Embedded content will not work in feeds without it.
    204. //    - See: http://core.trac.wordpress.org/ticket/12505
    205.  
    206. //    if ($data[ 'videoembed_value' ]) {
    207. //        $af_video_url = $data[ 'videoembed_value' ];
    208. //        $mediafeed = '[embed width="800" height="450"]' . $af_video_url . '[/embed]';
    209. //    }
    210.  
    211. //    If there’s no video is there an image thumbnail?
    212.     if ( has_post_thumbnail() ) {
    213.         $mediafeed = the_post_thumbnail('medium');
    214.     }
    215.  
    216. //    If there's a video or an image, display the media with the content
    217.     if ($mediafeed !== '') {
    218.         $content = '<p>' .$mediafeed . '</p><br />' . $content;
    219.         return $content;
    220.  
    221. //    If there's no media, just display the content
    222.     } else {
    223.         $content = $content;
    224.         return $content;
    225.     }
    226. }
    227. add_filter('the_content', 'autofocus_feed');
    228.  
    229. //    Add Post Thumbnails Support
    230. if ( function_exists( 'add_theme_support' ) ) { // Added in 2.9
    231.     add_theme_support( 'post-thumbnails' );
    232.     set_post_thumbnail_size( 88, 88, true ); // Default thumbnail size
    233.     add_image_size( 'archive-thumbnail', 188, 188, true ); // Archives thumbnail size
    234.     add_image_size( 'single-post-thumbnail', 940, 600 ); // Single Posts thumbnail size
    235.     add_image_size( 'front-page-thumbnail', 940, 368, true ); // Front Page thumbnail size
    236. }
    237.  
    238. //    Set default content width for images in post content
    239. $_GLOBALS['content_width'] = 494;
    240.  
    241. // Custom AutoFocus Thumbnail Sizes
    242. function af_image_sizes( $sizes ) {
    243.     $sizes[] = 'afthumb';
    244.     $sizes[] = 'aflarge';
    245.     $sizes[] = 'afsingle';
    246.     return $sizes;
    247. }
    248. add_filter( 'intermediate_image_sizes', 'af_image_sizes' );
    249.  
    250. //    Custom image size settings initiated at activation
    251. if ( is_admin() && isset($_GET['activated'] ) && $pagenow == 'themes.php' ) {
    252.     if( FALSE === get_option('af_size_w') ) {
    253.         add_option('afthumb_size_w', '188');
    254.         add_option('afthumb_size_h', '188');
    255.         add_option('afthumb_crop', '1');
    256.  
    257.         add_option('aflarge_size_w', '940');
    258.         add_option('aflarge_size_h', '368');
    259.         add_option('aflarge_crop', '0');
    260.  
    261.         add_option('afsingle_size_w', '940');
    262.         add_option('afsingle_size_h', '600');
    263.         add_option('afsingle_crop', '0');
    264.     } else {
    265.         update_option('afthumb_size_w', '188');
    266.         update_option('afthumb_size_h', '188');
    267.         update_option('afthumb_crop', '1');
    268.  
    269.         update_option('aflarge_size_w', '940');
    270.         update_option('aflarge_size_h', '368');
    271.         update_option('aflarge_crop', '0');
    272.  
    273.         update_option('afsingle_size_w', '940');
    274.         update_option('afsingle_size_h', '600');
    275.         update_option('afsingle_crop', '0');
    276.     }
    277.  
    278.     update_option('thumbnail_size_h', '88');
    279.     update_option('thumbnail_size_w', '88');
    280.     update_option('thumbnail_crop', '1');
    281.  
    282.     update_option('medium_size_h', '188');
    283.     update_option('medium_size_w', '188');
    284.     update_option('medium_crop', '0');
    285.  
    286.     update_option('large_size_h', '494');
    287.     update_option('large_size_w', '494');
    288.     update_option('large_crop', '0');
    289.  
    290.     update_option('thread_comments', '1');
    291.     update_option('thread_comments_depth', '2');
    292.    
    293.     update_option( 'posts_per_page', '12');
    294.     update_option( 'date_format', __('j M ’y') );
    295. }
    296.  
    297. //    Load Color Options
    298. function af_load_color_options() {
    299.     global $afoptions;
    300.     foreach ($afoptions as $afvalue) {
    301.         if (get_settings( $afvalue['id'] ) === FALSE) { $$afvalue['id'] = $afvalue['std']; } else { $$afvalue['id'] = get_settings( $afvalue['id'] ); }
    302.     } ?>
    303.     <style type="text/css">
    304.     /* <![CDATA[ */
    305.     /* AutoFocus+ Color Options */
    306. <?php $afcoloroptions = dirname( __FILE__ ) . '/css/af-styles.php'; if( is_file( $afcoloroptions ) ) require $afcoloroptions; ?>
    307.     /* ]]> */
    308.     </style>
    309. <?php }
    310. add_action('wp_head', 'af_load_color_options');
    311.  
    312. //    Post Options and Instructions
    313. //    - New Video Array For Video Embed Codes
    314. $key = "autofocus";
    315. $af_meta_boxes = array(
    316. "video" => array(
    317.     "name" => "videoembed_value",
    318.     "title" => __("Embed URL","thematic"),
    319.     "description" => __("Paste your oEmbed URL here. (Examples: http://vimeo.com/7757262, http://www.flickr.com/photos/bking/3598750242/)","thematic")),
    320. "copyright" => array(
    321.     "name" => "copyright_value",
    322.     "title" => __("Photo Credit","thematic"),
    323.     "description" => __("Text entered here will replace the default Photo credit. (Example: &copy; 2009 Image Author. All rights reserved.)<br />Using HTML here works but is not recommended.","thematic")),
    324.  
    325. "What I did" => array(
    326.     "name" => "whatidid_value",
    327.     "title" => __("What I did","thematic"),
    328.     "description" => __("hier kommt rein was ich gemacht habe.)<br />Using HTML here works but is not recommended.","thematic")),
    329. );
    330.  
    331. //    - New Meta Boxes For Video Embed Codes
    332. function display_meta_box() {
    333.     global $post, $af_meta_boxes, $key; ?>  
    334.  
    335.     <div class="form-wrap">  
    336.     <?php wp_nonce_field( plugin_basename( __FILE__ ), $key . '_wpnonce', false, true );  
    337.         foreach($af_meta_boxes as $meta_box) {
    338.         $data = get_post_meta($post->ID, $key, true); ?>
    339.  
    340.         <div class="form-field form-required">
    341.             <label for="<?php echo $meta_box[ 'name' ]; ?>"><?php echo $meta_box[ 'title' ]; ?></label>
    342.             <input type="text" name="<?php echo $meta_box[ 'name' ]; ?>" value="<?php echo htmlspecialchars( $data[ $meta_box[ 'name' ] ] ); ?>" />
    343.             <p><?php echo $meta_box[ 'description' ]; ?></p>
    344.         </div>
    345.     <?php } ?>
    346.     </div>
    347.  
    348. <?php }
    349.  
    350. //    - Create Form Data
    351. function create_meta_box() {
    352.     global $key;
    353.     if( function_exists( 'add_meta_box' ) ) {  
    354.         add_meta_box( 'new-meta-boxes', 'AutoFocus+ Post Options', 'display_meta_box', 'post', 'normal', 'high' );
    355.     }
    356. }
    357.  
    358. //    - Save Form Data
    359. function save_meta_box( $post_id ) {
    360.     global $post, $af_meta_boxes, $key;
    361.     foreach( $af_meta_boxes as $meta_box ) {
    362.         $data[ $meta_box[ 'name' ] ] = $_POST[ $meta_box[ 'name' ] ];
    363.     }
    364.  
    365.     if ( !wp_verify_nonce( $_POST[ $key . '_wpnonce' ], plugin_basename(__FILE__) ) )
    366.         return $post_id;
    367.  
    368.     if ( !current_user_can( 'edit_post', $post_id ))
    369.         return $post_id;
    370.         update_post_meta( $post_id, $key, $data );
    371. }
    372. add_action( 'admin_menu', 'create_meta_box' );
    373. add_action( 'save_post', 'save_meta_box' );
    374.  
    375. //    Theme Options --------------------------------------------
    376. $afthemename = "AutoFocus+";
    377. $afshortname = "af";
    378. $afoptions = array();
    379.  
    380. function autofocus_options() {
    381.     global $afthemename, $afshortname, $afoptions;
    382.         $af_categories_obj = get_categories('hide_empty=0');
    383.         $af_categories = array();
    384.         foreach ($af_categories_obj as $af_cat) {
    385.                 $af_categories[$af_cat->cat_ID] = $af_cat->cat_name;
    386.         }
    387.         $categories_std = array_unshift($af_categories, "Select a category:");
    388.  
    389.         $afoptions = array (
    390.                                        
    391.                 array(    "name" => __('Text Color'),
    392.                         "desc" => __('Change the color of links, backgrounds and borders by entering a HEX color number. (ie: <span style="font-family:Monaco,Lucida Console,Courier,monospace;">003333</span>)','thematic'),
    393.                         "id" => $afshortname."_text_color",
    394.                         "std" => "999999",
    395.                         "type" => "colorpicker"),
    396.  
    397.                 array(    "name" => __('Link Color','thematic'),
    398.                         "desc" => __('Change the color of hover links by entering a HEX color number. (ie: <span style="font-family:Monaco,Lucida Console,Courier,monospace;">FF6600</span>)','thematic'),
    399.                         "id" => $afshortname."_link_color",
    400.                         "std" => "00CCFF",
    401.                         "type" => "colorpicker"),
    402.  
    403.                 array(    "name" => __('Background Color','thematic'),
    404.                         "desc" => __('Change the color of hover links by entering a HEX color number. (ie: <span style="font-family:Monaco,Lucida Console,Courier,monospace;">FF6600</span>)','thematic'),
    405.                         "id" => $afshortname."_bg_color",
    406.                         "std" => "FFFFFF",
    407.                         "type" => "colorpicker"),
    408.  
    409.                 array(    "name" => __('Photo Background Color','thematic'),
    410.                         "desc" => __('Change the background color of Portrait (narrow) images by entering a HEX color number. (ie: <span style="font-family:Monaco,Lucida Console,Courier,monospace;">FF6600</span>. Note: If left empty, the background color will be transparent.','thematic'),
    411.                         "id" => $afshortname."_photo_color",
    412.                         "std" => "F0F0F0",
    413.                         "type" => "colorpicker"),
    414.  
    415.                 array(    "name" => __('Show Post Titles','thematic'),
    416.                         "desc" => __("Add a check here to show Post Titles instead of Post Dates on the home page.",'thematic'),
    417.                         "id" => $afshortname."_show_post_title",
    418.                         "std" => "false",
    419.                         "type" => "checkbox"),
    420.  
    421.                 array(    "name" => __('Show Exif data','thematic'),
    422.                         "desc" => __("Add a check here to show the Exif data for your images on attachment pages (WP Gallery Images only).",'thematic'),
    423.                         "id" => $afshortname."_show_exif_data",
    424.                         "std" => "false",
    425.                         "type" => "checkbox")
    426.  
    427.           );
    428. }
    429. add_action('init', 'autofocus_options');
    430.  
    431. //    Make a Theme Options Page
    432. function childtheme_add_admin() {
    433.  
    434.     global $afthemename, $afshortname, $afoptions;
    435.  
    436.     if ( $_GET['page'] == basename(__FILE__) ) {
    437.    
    438.         if ( 'save' == $_REQUEST['action'] ) {
    439.  
    440.                 foreach ($afoptions as $afvalue) {
    441.                     update_option( $afvalue['id'], $_REQUEST[ $afvalue['id'] ] ); }
    442.  
    443.                 foreach ($afoptions as $afvalue) {
    444.                     if( isset( $_REQUEST[ $afvalue['id'] ] ) ) { update_option( $afvalue['id'], $_REQUEST[ $afvalue['id'] ]  ); } else { delete_option( $afvalue['id'] ); } }
    445.  
    446.                 header("Location: themes.php?page=functions.php&saved=true");
    447.                 die;
    448.  
    449.         } else if( 'reset' == $_REQUEST['action'] ) {
    450.  
    451.             foreach ($afoptions as $afvalue) {
    452.                 delete_option( $afvalue['id'] ); }
    453.  
    454.             header("Location: themes.php?page=functions.php&reset=true");
    455.             die;
    456.  
    457.         }
    458.     }
    459.  
    460.     add_theme_page($afthemename." Options", "$afthemename Options", 'edit_themes', basename(__FILE__), 'childtheme_admin');
    461.  
    462. }
    463.  
    464. function childtheme_admin() {
    465.  
    466.     global $afthemename, $afshortname, $afoptions;
    467.  
    468.     if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>'.$afthemename.' settings saved.</strong></p></div>';
    469.     if ( $_REQUEST['reset'] ) echo '<div id="message" class="updated fade"><p><strong>'.$afthemename.' settings reset.</strong></p></div>';
    470.    
    471. ?>
    472. <script language="javascript" type="text/javascript" src="<?php echo bloginfo('stylesheet_directory') ?>/js/jscolor/jscolor.js"></script>
    473. <div class="wrap">
    474. <h2><?php echo $afthemename; ?> Options</h2>
    475.  
    476. <form method="post">
    477.  
    478. <table class="form-table">
    479.  
    480. <?php foreach ($afoptions as $afvalue) {
    481.    
    482.     switch ( $afvalue['type'] ) {
    483.         case 'text':
    484.         ?>
    485.         <tr valign="top">
    486.             <th scope="row"><?php echo $afvalue['name']; ?>:</th>
    487.             <td>
    488.                 <input name="<?php echo $afvalue['id']; ?>" id="<?php echo $afvalue['id']; ?>" type="<?php echo $afvalue['type']; ?>" value="<?php if ( get_settings( $afvalue['id'] ) != "") { echo get_settings( $afvalue['id'] ); } else { echo $afvalue['std']; } ?>" />
    489.                 <?php echo $afvalue['desc']; ?>
    490.             </td>
    491.         </tr>
    492.         <?php
    493.         break;
    494.        
    495.         case 'colorpicker':
    496.         ?>
    497.         <tr valign="top">
    498.             <th scope="row"><label for="<?php echo $afvalue['id']; ?>"><?php echo __($afvalue['name'],'thematic'); ?></label></th>
    499.             <td>
    500.                 <input type="<?php echo $afvalue['type']; ?>" name="<?php echo $afvalue['id']; ?>" id="<?php echo $afvalue['id']; ?>" value="<?php if ( get_option( $afvalue['id'] ) != "") { echo get_option( $afvalue['id'] ); } else { echo $afvalue['std']; } ?>" class="color {pickerPosition:'right'}" />
    501.                 <?php echo __($afvalue['desc'],'thematic'); ?>
    502.  
    503.             </td>
    504.         </tr>
    505.         <?php
    506.         break;
    507.        
    508.         case 'select':
    509.         ?>
    510.         <tr valign="top">
    511.             <th scope="row"><?php echo $afvalue['name']; ?></th>
    512.             <td>
    513.                 <select name="<?php echo $afvalue['id']; ?>" id="<?php echo $afvalue['id']; ?>">
    514.                     <?php foreach ($afvalue['options'] as $option) { ?>
    515.                     <option<?php if ( get_settings( $afvalue['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $afvalue['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
    516.                     <?php } ?>
    517.                 </select>
    518.                 <?php echo $afvalue['desc']; ?>
    519.             </td>
    520.         </tr>
    521.         <?php
    522.         break;
    523.        
    524.         case 'textarea':
    525.         $ta_options = $afvalue['options'];
    526.         ?>
    527.         <tr valign="top">
    528.             <th scope="row"><?php echo $afvalue['name']; ?>:</th>
    529.             <td>
    530.                 <?php echo $afvalue['desc']; ?>
    531.                 <textarea name="<?php echo $afvalue['id']; ?>" id="<?php echo $afvalue['id']; ?>" cols="<?php echo $ta_options['cols']; ?>" rows="<?php echo $ta_options['rows']; ?>"><?php
    532.                 if( get_settings($afvalue['id']) != "") {
    533.                         echo stripslashes(get_settings($afvalue['id']));
    534.                     }else{
    535.                         echo $afvalue['std'];
    536.                 }?></textarea>
    537.             </td>
    538.         </tr>
    539.         <?php
    540.         break;
    541.  
    542.         case "radio":
    543.         ?>
    544.         <tr valign="top">
    545.             <th scope="row"><?php echo $afvalue['name']; ?>:</th>
    546.             <td>
    547.                 <?php foreach ($afvalue['options'] as $key=>$option) {
    548.                 $radio_setting = get_settings($afvalue['id']);
    549.                 if($radio_setting != ''){
    550.                     if ($key == get_settings($afvalue['id']) ) {
    551.                         $checked = "checked=\"checked\"";
    552.                         } else {
    553.                             $checked = "";
    554.                         }
    555.                 }else{
    556.                     if($key == $afvalue['std']){
    557.                         $checked = "checked=\"checked\"";
    558.                     }else{
    559.                         $checked = "";
    560.                     }
    561.                 }?>
    562.                 <input type="radio" name="<?php echo $afvalue['id']; ?>" value="<?php echo $key; ?>" <?php echo $checked; ?> /><?php echo $option; ?><br />
    563.                 <?php } ?>
    564.             </td>
    565.         </tr>
    566.         <?php
    567.         break;
    568.        
    569.         case "checkbox":
    570.         ?>
    571.             <tr valign="top">
    572.                 <th scope="row"><?php echo $afvalue['name']; ?></th>
    573.                 <td>
    574.                    <?php
    575.                         if(get_settings($afvalue['id'])){
    576.                             $checked = "checked=\"checked\"";
    577.                         }else{
    578.                             $checked = "";
    579.                         }
    580.                     ?>
    581.                     <input type="checkbox" name="<?php echo $afvalue['id']; ?>" id="<?php echo $afvalue['id']; ?>" value="true" <?php echo $checked; ?> />
    582.                     <?php  ?>
    583.                 <?php echo $afvalue['desc']; ?>
    584.                 </td>
    585.             </tr>
    586.             <?php
    587.         break;
    588.  
    589.         default:
    590.  
    591.         break;
    592.     }
    593. }
    594. ?>
    595.  
    596. </table>
    597.  
    598. <p class="submit">
    599. <input name="save" type="submit" value="Save changes" />    
    600. <input type="hidden" name="action" value="save" />
    601. </p>
    602. </form>
    603. <form method="post">
    604. <p class="submit">
    605. <input name="reset" type="submit" value="Reset" />
    606. <input type="hidden" name="action" value="reset" />
    607. </p>
    608. </form>
    609.  
    610. <p><?php _e('For more information about this theme, visit the <a href="http://fthrwght.com/autofocus">documentation page</a>. If you have any questions, check out <a href="http://wpquestions.com/">WPQuestions.com</a>.', 'thematic'); ?></p>
    611.  
    612. <?php }
    613. add_action('admin_menu' , 'childtheme_add_admin');
    614.  
    615. //    Add Thematic Body and Post Classes, Comment form classes & RSS links
    616. define('THEMATIC_COMPATIBLE_BODY_CLASS', true);
    617. define('THEMATIC_COMPATIBLE_POST_CLASS', true);
    618. define('THEMATIC_COMPATIBLE_COMMENT_FORM', true);
    619. define('THEMATIC_COMPATIBLE_FEEDLINKS', true);
    620.  
    621. //    Add custom jQuery plugins and functions
    622. function af_enqueue_styles() {
    623.     if (!is_admin()) {
    624.         //    BOO IE6! :-/
    625.         if( browser_ie6() ) {
    626.             wp_enqueue_style('afiestyles', get_bloginfo('stylesheet_directory') . '/css/ie-styles.css','','20100329','all');
    627.         }
    628.     }
    629. }
    630. add_action('init', 'af_enqueue_styles');
    631.  
    632. //    Add jQuery Plugins when not in IE
    633. function af_enqueue_scripts() {
    634.     if( !browser_ie6() ) {
    635.         wp_enqueue_script('imgCenter', get_bloginfo('stylesheet_directory') . '/js/jquery.imgCenter.minified.js', array('jquery'), '20100329' );
    636.         wp_enqueue_script('hotkeys', get_bloginfo('stylesheet_directory') . '/js/jquery.hotkeys-0.7.9.min.js', array('jquery'), '20100329' );
    637.         wp_enqueue_script('autofocusjs', get_bloginfo('stylesheet_directory') . '/js/afscripts.js', array('jquery'), '20100329' );
    638.     }
    639. }
    640. add_action('wp_print_scripts', 'af_enqueue_scripts');
    641.  
    642. //    Load Thematic Functions
    643. require_once(STYLESHEETPATH . '/thematic-functions.php');
    644.  
    645. ?>
    Thematic-Functions:
    PHP:
    1. <?php
    2.  
    3. //    Favorite Icon
    4. function autofocus_favicon() { ?>
    5.     <link rel="shortcut icon" href="<?php echo bloginfo('stylesheet_directory') ?>/img/favicon.ico">
    6. <?php }
    7. add_action('wp_head', 'autofocus_favicon', 1);
    8.  
    9. //    Add a Home link to your menu
    10. //    updated for Thematic 0.9.7.7
    11. function childtheme_menu_args($args) {
    12.         $args = array(
    13.         'show_home' => 'Home',
    14.         'sort_column' => 'menu_order',
    15.         'menu_class' => 'menu',
    16.         'echo' => false
    17.     );
    18.     return $args;
    19. }
    20. add_filter('wp_page_menu_args','childtheme_menu_args', 20);
    21.  
    22. //    Create Arrow Navigation
    23. //    - remove default navigation
    24. function remove_thematic_actions() {
    25.     remove_action('thematic_navigation_above', 'thematic_nav_above', 2);
    26.     remove_action('thematic_navigation_below', 'thematic_nav_below', 2);
    27. }
    28. add_action('init','remove_thematic_actions');
    29.  
    30. //    - add arrow navigation
    31. function autofocus_nav_above() {
    32.     if (is_single()) { ?>
    33.             <div id="nav-above" class="navigation">
    34.                 <div class="nav-previous"><?php previous_post_link('%link', __('<span class="meta-nav">&larr;</span>', 'thematic')) ?></div>
    35.                 <div class="nav-next"><?php next_post_link('%link', __('<span class="meta-nav">&rarr;</span>', 'thematic')) ?></div>
    36.             </div>
    37.    
    38. <?php } else { ?>
    39.             <div id="nav-above" class="navigation">
    40.                 <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">&larr;</span>', 'thematic')) ?></div>
    41.                 <div class="nav-next"><?php previous_posts_link(__('<span class="meta-nav">&rarr;</span>', 'thematic')) ?></div>
    42.             </div>    
    43.    
    44. <?php } }
    45. add_action('thematic_navigation_above', 'autofocus_nav_above', 2);
    46.  
    47. //    Add arrows to the Post excerpt
    48. function autofocus_readmore($text) {
    49.     //    No arrows on the Home page excerpts
    50.     if (is_home() || is_feed()) {
    51.         return str_replace('[...]', ' &hellip;', $text);
    52.     } else {
    53.         return str_replace('[...]', ' &hellip; <a href="'.get_permalink().'" class="more-link">' . __('Read More ', 'thematic') . '<span class="excerpt-arrow">&rarr;</span></a>', $text);
    54. } }
    55. add_filter('get_the_excerpt', 'autofocus_readmore');
    56.  
    57. //    Add New Excerpt Word Count
    58. function autofocus_excerpt_length($length) {
    59.     //    Add more words for the Archive pages
    60.     if (is_archive() || is_search()) {
    61.         return 45;
    62.     } else {
    63.         return 25;
    64. } }
    65. add_filter('excerpt_length', 'autofocus_excerpt_length');
    66.  
    67. //    Show excerpts on Home pages and Archives
    68. function autofocus_content($content) {
    69.     global $content;
    70.     if ( is_archive() || is_front_page() || is_search() ) {
    71.         $content= 'excerpt';
    72.     } else {
    73.         $content= 'full';
    74.     }
    75.     return $content;
    76. }
    77. add_filter('thematic_content', 'autofocus_content');
    78.  
    79. //    Add <p> Tags to Excerpts
    80. function autofocus_excerpt_autop() {
    81.     global $content;
    82.  
    83.     if ( strtolower($content) == 'full' ) {
    84.         $post = get_the_content(more_text());
    85.         $post = apply_filters('the_content', $post);
    86.         $post = str_replace(']]>', ']]>', $post);
    87.  
    88.     } elseif ( strtolower($content) == 'excerpt') {
    89.         $post = get_the_excerpt();
    90.  
    91.         //    add in the <p>
    92.         $post = wpautop($post);
    93.  
    94.     } elseif ( strtolower($content) == 'none') {
    95.     } else {
    96.         $post = get_the_content(more_text());
    97.         $post = apply_filters('the_content', $post);
    98.         $post = str_replace(']]>', ']]>', $post);
    99.     }
    100.     return $post;
    101. }
    102. add_filter('thematic_post','autofocus_excerpt_autop');
    103.  
    104. // Add the Featured/Sticky Post section
    105. function af_sticky_area() {
    106. global $afoptions;
    107. foreach ($afoptions as $value) {
    108.     if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }
    109. }
    110. $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    111.  
    112.     if( is_home() && !is_paged() ) { ?>
    113.  
    114.         <?php if (get_option('sticky_posts')) { ?>
    115.             <?php
    116.             $sticky = get_option('sticky_posts');
    117.             $randomStickyNo = 0;
    118.             $randomStickyNo = (rand()%(count($sticky)));
    119.             $postno = $sticky[($randomStickyNo)];
    120.             $temp = $stickyquery;
    121.             $stickyquery = null;
    122.             $stickyquery = new WP_Query();
    123.             $stickyquery->query('orderby=rand&showposts=1&p=' . $postno); ?>
    124.  
    125.             <?php while ($stickyquery->have_posts()) : $stickyquery->the_post(); $do_not_duplicate = $post->ID; ?>
    126.                 <div id="sticky-feature">
    127.                     <div id="post-<?php the_ID() ?>" class="<?php thematic_post_class(); ?> sticky-feature-post">
    128.  
    129.                 <?php echo thematic_postheader_posttitle(); ?>
    130.  
    131.                         <div class="entry-meta">
    132.                 <?php if ($af_show_post_title == 'false') { ?>
    133.                            
    134.                 <?php } ?>
    135.                         </div>
    136.                 <?php if ( has_post_thumbnail() ) { ?>
    137.                         <a href="<?php the_permalink() ?>" rel="bookmark" class="post-image-container"><?php the_post_thumbnail('aflarge'); ?></a>
    138.                 <?php } else { ?>
    139.                         <a href="<?php the_permalink() ?>" rel="bookmark" class="post-image-container"><?php the_post_image('aflarge'); ?></a>
    140.                 <?php } ?>
    141.                
    142.                         <div class="entry-content">
    143.                 <?php the_excerpt(); ?>
    144.                         </div>
    145.                
    146.                         <div class="entry-utility">
    147.                             <?php edit_post_link(__('Edit', 'thematic'), "\t\n\t\t\t\t\t<span class=\"edit-link\">", "</span>\n"); ?>
    148.                         </div><!-- .entry-utility -->
    149.                     </div>
    150.                 </div><!-- #sticky-feature -->
    151.  
    152.             <?php endwhile; ?>
    153.  
    154.             <?php query_posts(array(
    155.                     'post__not_in' =>get_option('sticky_posts'),
    156.                     'caller_get_posts' => 1,
    157.                     'paged' => $paged,
    158.                     )); ?>
    159.  
    160.         <?php } ?>
    161.        
    162.     <?php } else { ?>
    163.  
    164.         <?php query_posts(array(
    165.                 'post__not_in' =>get_option('sticky_posts'),
    166.                 'caller_get_posts' => 1,
    167.                 'exclude' => $postno,
    168.                 'paged' => $paged,
    169.                 )); ?>
    170.  
    171.     <?php } ?>
    172.  
    173. <?php }
    174. add_action('thematic_above_indexloop','af_sticky_area');
    175.  
    176. //    Custom Post Header
    177. function autofocus_postheader() {
    178.     global $post;
    179.     global $afoptions;
    180.     foreach ($afoptions as $value) {
    181.         if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }
    182.     }
    183.  
    184.     $data = get_post_meta( $post->ID, 'autofocus', true );
    185.  
    186.     if (is_page()) { ?>
    187.         <h2 class="entry-title"><?php the_title(); ?></h2>
    188.  
    189. <?php } elseif (is_404()) { ?>
    190.         <h2 class="entry-title">Not Found</h2>
    191.  
    192. <?php } elseif (is_single()) { ?>
    193.        
    194.         <?php if ($data[ 'videoembed_value' ]) {  ?>
    195.             <div class="post-video-container">
    196.         <?php $af_video_url = $data[ 'videoembed_value' ]; $content = apply_filters('the_content', '<span>[embed width="800" height="600"]'.$af_video_url.'[/embed]</span>'); echo $content; ?>
    197.             </div>
    198.        
    199.         <?php } else { ?>
    200.             <div class="post-image-container">
    201.             <?php if ($data[ 'copyright_value' ]) {  ?>
    202.                 <span class="photo-credit"><?php echo $data[ 'copyright_value' ]; ?></span>
    203.             <?php } else { ?>
    204.                 <?php autofocus_credit(); ?>
    205.             <?php } ?>
    206.  
    207.             <?php if ( has_post_thumbnail() ) { ?>
    208.                     <?php the_post_thumbnail('single-post-thumbnail'); ?>
    209.  
    210.             <?php } else { ?>
    211.                 <?php the_post_image('afsingle'); ?>
    212.  
    213.             <?php } ?>
    214.             </div>
    215.         <?php } ?>
    216.        
    217.         <h2 class="entry-title"><?php the_title(); ?></h2>
    218.  
    219. <?php } elseif (is_archive() || is_search()) { ?>
    220.  
    221.     <?php if ( $post->post_type == 'post' ) { //    Hide entry utility on searches ?>
    222.            
    223.         <?php if ( has_post_thumbnail() ) { ?>
    224.                 <a href="<?php the_permalink() ?>" rel="bookmark" class="post-image-container"><?php the_post_thumbnail('archive-thumbnail'); ?></a>
    225.         <?php } else { ?>
    226.                 <a href="<?php the_permalink() ?>" rel="bookmark" class="post-image-container"><?php the_post_image('afthumb'); ?></a>
    227.         <?php } ?>
    228.  
    229.     <?php } ?>                
    230.  
    231.         <h3 class="entry-title"><a href="<?php the_permalink() ?>" title="<?php printf(__('Permalink to %s', 'thematic'), wp_specialchars(get_the_title(), 1)) ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    232.  
    233. <?php } else { ?>
    234.         <h2 class="entry-title"><a href="<?php the_permalink() ?>" title="<?php printf(__('Permalink to %s', 'thematic'), wp_specialchars(get_the_title(), 1)) ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    235.  
    236. <?php } }
    237. add_filter ('thematic_postheader_posttitle', 'autofocus_postheader');
    238.  
    239. //    AutoFocus Post Meta
    240. function autofocus_postmeta() {
    241.     global $post;
    242.     global $afoptions;
    243.     foreach ($afoptions as $value) {
    244.         if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }
    245.     }
    246.  
    247.     $data = get_post_meta( $post->ID, 'autofocus', true );
    248.  
    249.     if (is_single()) { ?>
    250.                 <div class="entry-meta">
    251.                     <abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO') ?>"><?php the_time('j M') ?></abbr></span>
    252.                     <?php if ($af_show_exif_data == 'true' && has_post_thumbnail() && ($data[ 'videoembed_value' ] == '')) { ?>
    253.                     <span class="exif-data"><a href="<?php echo exif_link(); ?>/#exif-data"><?php _e('View Exif Data', 'thematic') ?></a></span>
    254.                     <?php } ?>
    255.                     <span class="cat-links"><?php printf(__('Filed under %s.', 'thematic'), get_the_category_list(', ')) ?></span>
    256.                     <?php echo get_the_tag_list("<span class=\"tag-links\"> Tagged ",', ','.</span>'); ?>
    257.                     <?php echo autofocus_postconnect(); ?>
    258.                     <?php edit_post_link(__('Edit', 'thematic'), "\t\n\t\t\t\t\t<span class=\"edit-link\">", "</span>\n"); ?>
    259.                 </div>
    260.  
    261. <?php } elseif (is_home()) { ?>
    262.  
    263.         <?php if ($af_show_post_title == 'false') { ?>
    264.             <div class="entry-meta">
    265.                 <a href="<?php the_permalink() ?>" class="published" title="<?php the_time('Y-m-d\TH:i:sO') ?>" rel="bookmark"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO') ?>"><?php the_time('j M') ?></abbr></a></span>
    266.             </div>
    267.  
    268.         <?php } elseif ($af_show_post_title == 'true') { ?>
    269.            
    270.  
    271.         <?php } ?>
    272.                
    273.         <?php if ( has_post_thumbnail() ) { ?>
    274.                     <a href="<?php the_permalink() ?>" rel="bookmark" class="post-image-container"><?php the_post_thumbnail('front-page-thumbnail'); ?></a>
    275.         <?php } else { ?>
    276.                     <a href="<?php the_permalink() ?>" rel="bookmark" class="post-image-container"><?php the_post_image('aflarge'); ?></a>
    277.         <?php } ?>
    278.                
    279. <?php } else { ?>
    280.                 <div class="entry-meta">
    281.                     <abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO') ?>"><?php the_time('j M') ?></abbr></span>
    282.                     <span class="cat-links"><?php printf(__('Filed under %s.', 'thematic'), get_the_category_list(', ')) ?></span>
    283.                     <span class="comments-link"><?php comments_popup_link(__('No comments.', 'thematic'), __('1 Comment.', 'thematic'), __('% Comments.', 'thematic'), '', '') ?></span>
    284.                     <?php edit_post_link(__('Edit', 'thematic'), "\t\n\t\t\t\t\t<span class=\"edit-link\">", "</span>\n"); ?>
    285.                 </div>
    286.  
    287. <?php } }
    288. add_filter ('thematic_postheader_postmeta', 'autofocus_postmeta');
    289.  
    290. //    AutoFocus Post Footer
    291. function autofocus_postfooter() {
    292.     global $post;
    293.  
    294.     if (is_single() || is_page()) {
    295.         if (is_sidebar_active('single-sidebar')) {
    296.             echo thematic_before_widget_area('single-sidebar');
    297.             dynamic_sidebar('single-sidebar');
    298.             echo thematic_after_widget_area('single-sidebar');
    299.         } ?>
    300.  
    301.     <?php } elseif (is_home()) { ?>
    302.         <div class="entry-utility">
    303.             <?php edit_post_link(__('Edit', 'thematic'), "\t\n\t\t\t\t\t<span class=\"edit-link\">", "</span>\n"); ?>
    304.         </div><!-- .entry-utility -->
    305.  
    306.     <?php } else {
    307.         //    Show nothing
    308.     }
    309. }
    310. add_filter ('thematic_postfooter', 'autofocus_postfooter');
    311.  
    312. //    AutoFocus Post Connect
    313. function autofocus_postconnect() { ?>
    314.     <?php printf(__('<span class="bookmark">Bookmark the <a href="%1$s" title="Permalink to %2$s" rel="bookmark">permalink</a>.</span>', 'thematic'),
    315.         get_permalink(),
    316.         wp_specialchars(get_the_title(), 'double') ) ?>
    317.     <?php if ((comments_open()) && (pings_open())) : //    Comments and trackbacks open ?>
    318.             <?php printf(__('<span class="post-a-comment"><a class="comment-link" href="#respond" title="Post a comment">Post a comment</a>.</span> <span class="trackback">Leave a <a class="trackback-link" href="%s" title="Trackback URL for your post" rel="trackback">Trackback (URL)</a>.</span>', 'thematic'), get_trackback_url()) ?>
    319.     <?php elseif (!(comments_open()) && (pings_open())) : //    Only trackbacks open ?>
    320.             <?php printf(__('<span class="trackback">Leave a <a class="trackback-link" href="%s" title="Trackback URL for your post" rel="trackback">Trackback (URL)</a>.</span>', 'thematic'), get_trackback_url()) ?>
    321.     <?php elseif ((comments_open()) && !(pings_open())) : //    Only comments open ?>
    322.             <?php printf(__('<span class="post-a-comment"><a class="comment-link" href="#respond" title="Post a comment">Post a comment</a>.</span>', 'thematic')) ?>
    323.     <?php elseif (!(comments_open()) && !(pings_open())) : //    Comments and trackbacks closed ?>
    324.             <?php // Show nothing ?>
    325.     <?php endif; ?>
    326. <?php }
    327. // add_filter('thematic_postfooter_postconnect', 'autofocus_postconnect');
    328.  
    329. //    Navigation Below.
    330. function autofocus_nav_below() {
    331.     if (is_single()) { ?>
    332.             <div id="nav-below" class="navigation">
    333.                 <h3><?php _e('Browse', 'thematic') ?></h3>
    334.         <?php
    335.             $previouspost = get_previous_post($in_same_cat, $excluded_categories);
    336.             if ($previouspost != null) {
    337.            
    338.             echo '<div class="nav-previous">';
    339.             previous_post_link('<span class="meta-nav">&larr;</span> Older: %link');
    340.             echo '<div class="nav-excerpt">';
    341.             previous_post_excerpt();
    342.             echo '</div></div>';
    343.              } ?>
    344.  
    345.         <?php
    346.             $nextpost = get_next_post($in_same_cat, $excluded_categories);
    347.             if ($nextpost != null) {
    348.            
    349.             echo '<div class="nav-next">';
    350.             next_post_link('Newer: %link <span class="meta-nav">&rarr;</span>');
    351.             echo '<div class="nav-excerpt">';
    352.             next_post_excerpt();
    353.             echo '</div></div>';
    354.              } ?>
    355.  
    356.             </div><!-- #nav-below -->
    357.    
    358. <?php } elseif (browser_ie6() && is_home() ) { ?>
    359.            
    360.             <div id="nav-below" class="navigation">
    361.                 <div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">&larr;</span>', 'thematic')) ?></div>
    362.                 <div class="nav-next"><?php previous_posts_link(__('<span class="meta-nav">&rarr;</span>', 'thematic')) ?></div>
    363.             </div>    
    364.  
    365. <?php } }
    366. add_action('thematic_navigation_below', 'autofocus_nav_below', 2);
    367.  
    368. //    UNregister non-used sidebars
    369. function childtheme_sidebars_init() {
    370.    
    371.     // Register the 4th Subsidairy Sidebar
    372.     register_sidebar(array(
    373.         'name' => '4th Subsidiary Aside',
    374.         'id' => '4th-subsidiary-aside',
    375.         'description' => __('The 4th widget area in the footer.', 'thematic'),
    376.         'before_widget' => thematic_before_widget(),
    377.         'after_widget' => thematic_after_widget(),
    378.         'before_title' => thematic_before_title(),
    379.         'after_title' => thematic_after_title(),
    380.     ));
    381.  
    382.     // Register the Single Page Sidebar
    383.     register_sidebar(array(
    384.         'name' => 'Single Page Sidebar',
    385.         'id' => 'single-sidebar',
    386.         'description' => __('This widget area shows up under the post meta on Single Posts and Pages.', 'thematic'),
    387.         'before_widget' => thematic_before_widget(),
    388.         'after_widget' => thematic_after_widget(),
    389.         'before_title' => thematic_before_title(),
    390.         'after_title' => thematic_after_title(),
    391.     ));
    392.  
    393.     unregister_sidebar('primary-aside');
    394.     unregister_sidebar('secondary-aside');
    395.     unregister_sidebar('index-top');
    396.     unregister_sidebar('index-insert');
    397.     unregister_sidebar('index-bottom');
    398.     unregister_sidebar('single-top');
    399.     unregister_sidebar('single-insert');
    400.     unregister_sidebar('single-bottom');
    401.     unregister_sidebar('page-top');
    402.     unregister_sidebar('page-bottom');
    403. }
    404. add_action( 'init', 'childtheme_sidebars_init',20 );
    405.  
    406. // Add 4th Sidebar Area
    407. function add_fourth_sidebar() {
    408.     if (is_sidebar_active('4th-subsidiary-aside')) {
    409.         echo thematic_before_widget_area('4th-subsidiary-aside');
    410.         dynamic_sidebar('4th-subsidiary-aside');
    411.         echo thematic_after_widget_area('4th-subsidiary-aside');
    412.     }
    413. }
    414. add_action('thematic_after_third_sub','add_fourth_sidebar');
    415.  
    416. //    Add a link to the footer for credit
    417. function childtheme_theme_link($themelink) {
    418.     $loginlinkage = thmfooter_login_link();
    419.     return '<a class="child-theme-link" href="http://fthrwght.com/autofocus/" title="AutoFocus Pro" rel="theme">AutoFocus Pro Child Theme</a> &amp; the ' . $themelink . '. ' . $loginlinkage;
    420. }
    421. add_filter('thematic_theme_link', 'childtheme_theme_link');
    422.  
    423. // Adds commented credit
    424. function author_credit() { ?>
    425. <!-- Design based on AutoFocus Pro by Allan Cole for http://fthrwght.com/autofocusplus -->
    426. <?php }
    427. add_action('wp_footer','author_credit');
    428.  
    429. ?>
     
    Zuletzt bearbeitet: 25.01.2011
    #1      
  2. floei

    floei freundlicher Helfer

    Dabei seit:
    22.03.2008
    Beiträge:
    714
    Geschlecht:
    männlich
    Ort:
    Stuttgart
    Software:
    CS4 Production Premium,Cinema4D
    Kameratyp:
    Canon EOS 500D
    Autofocus+ Theme Custom Field hinzufügen
    AW: Autofocus+ Theme Custom Field hinzufügen

    Keiner ne Ahnung!?
     
    #2      
Die Seite wird geladen...
© 2002 - 2016 PSD-Tutorials.de – ein Projekt mit der 4eck Media GmbH & Co. KG
x
×
×