/**
* framework functions and definitions
* @package WordPress
* @subpackage CYSY Framework 3
* @since CYSY Framework 3.0
*/
/* ........................... CUSTOM POST TYPES ................................ */
/* Below is an include to a default custom post type.
To turn it off, just remove the code or comment it out.*/
//include(TEMPLATEPATH . '/library/post_types.php');
/* .............................. CUSTOM FIELDS FOR POSTS/PAGES .................. */
/* Below is an include to default custom fields for the blog posts.
To turn it off, just remove the code or comment it out.*/
//include(TEMPLATEPATH . '/library/custom_fields.php');
// This theme styles the visual editor with editor-style.css to match the theme style.
add_editor_style();
// This theme uses post thumbnails
if ( function_exists( 'add_theme_support' ) ) { // WP 2.9 or Greater
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 300, 250, true ); // Normal Post Thumbnail
add_image_size( 'featured-homepage', 640, 310, true ); // Home Page Featured Thumbnail
add_image_size( 'tab-thumbnail', 60, 60, true ); // For Tabs
add_image_size( 'archive-photo-thumbnail', 225, 150, true ); // Archive Thumbnail
add_theme_support( 'automatic-feed-links' );
}
//................... CUSTOM NAV MENU ..................................................//
// If you'd like to add a custom navigation to the site, uncomment the block of code below:
// Go to http://codex.wordpress.org/Function_Reference/wp_nav_menu for questions about usage
// CYSY Framework 3 Copyright(c) 2012-2013 - CYber SYtes, Inc. All Rights Reserved
// To register a custom nav so that you can update it from wordpress back office:
register_nav_menus( array(
'primary' => __( 'Primary Navigation', 'CYSY Framework 3' ),
) );
// To display custom nav in theme use:
//*** wp_nav_menu( array( 'container_class' => 'your_navigation_container', 'theme_location' => 'primary' ) ); ? >
//.................. GIVE CUSTOM NAV MENU ABILITY FOR DESCRIPTIONS .................. //
// CYSY Framework 3 Copyright(c) 2012-2013 - CYber SYtes, Inc. All Rights Reserved
// To apply this to a theme simply add an item to the wp_nav_menu array like so:
// $walker = new My_Walker;
// wp_nav_menu(array(
// 'menu_class' => 'navigation',
// 'theme_location' => 'primary-menu',
// 'walker' => $walker
// ));
// ? >
class My_Walker extends Walker_Nav_Menu
{
function start_el(&$output, $item, $depth, $args) {
global $wp_query;
$indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
$class_names = $value = '';
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) );
$class_names = '';
$output .= $indent . '
id="li-comment- comment_ID(); ?>">
break;
case 'pingback' :
case 'trackback' :
?>
_e( 'Pingback:', 'CYSY Framework 3' ); ?> comment_author_link(); ?> edit_comment_link( __('(Edit)', 'CYSY Framework 3'), ' ' ); ?>
break;
endswitch;
}
endif;
/**
* Register widgetized areas, including two sidebars widgets for this framework.
// CYSY Framework 3 Copyright(c) 2012-2013 - CYber SYtes, Inc. All Rights Reserved
* @since CYSY Framework 3
* @uses register_sidebar
*/
// Area 1, located at the top of the sidebar.
register_sidebar( array(
'name' => __( 'Primary Widget Area', 'CYSY Framework 3' ),
'id' => 'primary-widget-area',
'description' => __( 'The primary widget area', 'CYSY Framework 3' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
) );
// Area 2, located below the Primary Widget Area in the sidebar. Empty by default.
register_sidebar( array(
'name' => __( 'Secondary Widget Area', 'CYSY Framework 3' ),
'id' => 'secondary-widget-area',
'description' => __( 'The secondary widget area', 'CYSY Framework 3' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
) );
/**
* Removes the default styles that are packaged with the Recent Comments widget.
*
* To override this in a child theme, remove the filter and optionally add your own
* function tied to the widgets_init action hook.
*
*/
function framework_remove_recent_comments_style() {
global $wp_widget_factory;
remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );
}
add_action( 'widgets_init', 'framework_remove_recent_comments_style' );
if ( ! function_exists( 'framework_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post—date/time and author.
*
*/
function framework_posted_on() {
printf( __( 'Posted on %2$s by %3$s', 'CYSY Framework 3' ),
'meta-prep meta-prep-author',
sprintf( '%3$s',
get_permalink(),
esc_attr( get_the_time() ),
get_the_date()
),
sprintf( '%3$s',
get_author_posts_url( get_the_author_meta( 'ID' ) ),
sprintf( esc_attr__( 'View all posts by %s', 'CYSY Framework 3' ), get_the_author() ),
get_the_author()
)
);
}
endif;
if ( ! function_exists( 'framework_posted_in' ) ) :
/**
* Prints HTML with meta information for the current post (category, tags and permalink).
*
*/
function framework_posted_in() {
// Retrieves tag list of current post, separated by commas.
$tag_list = get_the_tag_list( '', ', ' );
if ( $tag_list ) {
$posted_in = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the permalink.', 'CYSY Framework 3' );
} elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) {
$posted_in = __( 'This entry was posted in %1$s. Bookmark the permalink.', 'CYSY Framework 3' );
} else {
$posted_in = __( 'Bookmark the permalink.', 'CYSY Framework 3' );
}
// Prints the string, replacing the placeholders.
printf(
$posted_in,
get_the_category_list( ', ' ),
$tag_list,
get_permalink(),
the_title_attribute( 'echo=0' )
);
}
endif;
// Pull an image URL from the media gallery
function sp_get_image($num = 0) {
global $post;
$children = get_children(array(
'post_parent' => $post->ID,
'post_type' => 'attachment',
'post_mime_type' => 'image',
'orderby' => 'menu_order',
'order' => 'ASC'
));
$count = 0;
foreach ((array)$children as $key => $value) {
$images[$count] = $value;
$count++;
}
if(isset($images[$num]))
return wp_make_link_relative(wp_get_attachment_url($images[$num]->ID));
else
return false;
}
/********************* THESE LINES OF CODE ARE FOR THE .htaccess file
The first two lines of code are used to allow you to include .php files from outside of the /wordpress/ directory.
The next two lines of code are used for increasing the upload sizes for media to wordpress.
*** These lines below need to be added to the top of the .htaccess file that is in the root of the site.
php_value allow_url_fopen on
php_value allow_url_include on
php_value post_max_size 8M
php_value upload_max_filesize 8M
*/
/*** THIS MODIFIES THE ADMIN LOGIN SCREEN LOGO TO DISPLAY A
CUSTOM LOGO FROM THE THEME DIRECTORY.
add_filter( 'login_headerurl', 'namespace_login_headerurl' );
/**
* Replaces the login header logo URL
*
* @param $url
*/
function namespace_login_headerurl( $url ) {
$url = home_url( '/' );
return $url;
}
add_filter( 'login_headertitle', 'namespace_login_headertitle' );
/**
* Replaces the login header logo title
*
* @param $title
*/
function namespace_login_headertitle( $title ) {
$title = get_bloginfo( 'name' );
return $title;
}
add_action( 'login_head', 'namespace_login_style' );
/**
* Replaces the login header logo
*/
function namespace_login_style() {
echo '';
}
// remove version info from head and feeds
// for security buff
function complete_version_removal() {
return '';
}
add_filter('the_generator', 'complete_version_removal');
// Reformatts dashboard to eliminate a lot of the annoying things our clients see first off.
add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');
function my_custom_dashboard_widgets() {
global $wp_meta_boxes;
//Right Now - Comments, Posts, Pages at a glance
//unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
//Recent Comments
//unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
//Incoming Links
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
//Plugins - Popular, New and Recently updated Wordpress Plugins
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
//Wordpress Development Blog Feed
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
//Other Wordpress News Feed
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
//Quick Press Form
//unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
//Recent Drafts List
//unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);
}
// remove unncessary header info in the of our sites
function remove_header_info() {
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'start_post_rel_link');
remove_action('wp_head', 'index_rel_link');
remove_action('wp_head', 'adjacent_posts_rel_link');
}
add_action('init', 'remove_header_info');
// remove extra css that recent comments widget injects
function remove_recent_comments_style() {
global $wp_widget_factory;
remove_action('wp_head', array($wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style'));
}
add_action('widgets_init', 'remove_recent_comments_style');
// this changes the footer in the admin section of wordpress
function remove_footer_admin () {
echo 'Site Developed by: CYber SYtes, Inc. Web SYtes by Design';
}
add_filter('admin_footer_text', 'remove_footer_admin');
//this line of code removes the error messages above login screen if incorrect login is entered.
// basically removes information hackers could use to know if they're having success.
add_filter('login_errors',create_function('$a', "return null;"));
//remove please update now link for clients, but keeps it live for admins
if ( !current_user_can( 'edit_users' ) ) {
remove_action('admin_notices','update_nag',3);
}
//remove links menu tab from wordpress installs, because we don't use them.
function sb_remove_admin_menus(){
if ( function_exists('remove_menu_page') ) {
remove_menu_page('link-manager.php'); // Remove the Links tab by providing its slug
}
}
add_action('admin_menu', 'sb_remove_admin_menus');
?>{"version":"1.0","provider_name":"ParsCo Construction","provider_url":"https:\/\/www.pars-co.net","title":"Benefits of using a Pre-Engineered Metal Building","type":"rich","width":600,"height":338,"html":"Benefits of using a Pre-Engineered Metal Building<\/a><\/blockquote>
endif; ?>