This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php } elseif ( is_category('6') ) { // !카테고리 공지사항 ?> | |
<?php // get the current category | |
$category = get_the_category(); | |
// get the sticky post in the category | |
query_posts(array( 'post__in' => get_option('sticky_posts'), 'cat' => ''.$category[0]->cat_ID.'' )); | |
if (have_posts()) : while (have_posts()) : the_post(); | |
get_template_part('includes/entry', 'index'); | |
endwhile; endif; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action='<?php echo wp_login_url( $_SERVER['REQUEST_URI'] ); ?>' method='post'> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Change footer text in WordPress admin panel ************************************************** | |
** http://www.instantshift.com/2012/03/06/21-most-useful-wordpress-admin-page-hacks/ ********* */ | |
/* !관리자 페이지 푸터 카피라이트 변경 ************************************************************** */ | |
function remove_footer_admin () { | |
echo '상록수장학재단을 찾아주셔서 감사합니다.'; | |
} | |
add_filter('admin_footer_text', 'remove_footer_admin'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Non login users Exclude Categories 'author', 'day', 'month', 'year' ************************************************** | |
** http://stackoverflow.com/questions/2789228/exclude-category-from-wp-get-archives ********************************** */ | |
/* !로그인하지 않은 유저, 특정 카테고리 접근 제외 ***************************************************************************** */ | |
function exclude_stuff($query) { | |
if ( !is_user_logged_in() && ( $query->is_day || $query->is_month || $query->is_year || $query->is_author || $query->is_search ) ) { | |
$query->set('cat', '-12, -14'); | |
} | |
elseif ( is_home() ) { // 가장 최근글로부터 sticky 포스트 제거 - http://wordpress.org/support/topic/remove-sticky-posts-from-posts-page | |
$query->set( 'ignore_sticky_posts', true ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Remove page and post write panel features ********************************************************************** | |
** http://wpmu.org/remove-page-and-post-write-panel-features/ ***************************************************** | |
** http://wordpress.stackexchange.com/questions/2025/removing-metabox-for-slug-without-removing-functionality ** */ | |
/* !관리자외 글쓰기 패널 삭제 *************************************************************************************** */ | |
add_action('admin_init', 'my_custom_write_panel'); | |
function my_custom_write_panel() { | |
//if ( !current_user_can( 'delete_others_posts' ) ) { // if user is below Editor level | |
//if ( !current_user_can( 'manage_options' ) ) { // if user is below Administrator level | |
remove_post_type_support( 'post', 'excerpt' ); | |
remove_post_type_support( 'post', 'custom-fields' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Remove 'Media' and 'Tool' menus for non admin users ******************************************* | |
** http://www.instantshift.com/2012/03/06/21-most-useful-wordpress-admin-page-hacks/ ********** */ | |
/* !관리자외 미디어 메뉴 삭제 ********************************************************************** */ | |
add_action( 'admin_menu', 'remove_links_menu' ); | |
function remove_links_menu() { | |
//if (!current_user_can('manage_options')) { // if user is below Administrator level | |
remove_menu_page('upload.php'); // Media | |
remove_menu_page('tools.php'); // Tools | |
remove_menu_page('link-manager.php'); // Tools | |
//} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Display Current User Role *************************************************************************** */ | |
/* http://wordpress.org/support/topic/how-to-get-the-current-logged-in-users-role ********************** */ | |
/* !로그인 회원역할 표시 *********************************************************************************** */ | |
/* <?php echo get_current_user_role(); ?> in your template ******************************************** */ | |
function get_current_user_role() { | |
global $wp_roles; | |
$current_user = wp_get_current_user(); | |
$roles = $current_user->roles; | |
$role = array_shift($roles); | |
return isset($wp_roles->role_names[$role]) ? translate_user_role($wp_roles->role_names[$role] ) : false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 'Role' name change ******************************************************************************************** | |
** http://wordpress.stackexchange.com/questions/23026/is-there-way-to-rename-user-role-name-without-plugin **** */ | |
/* !회원 역할 이름 바꾸기 ***************************************************************************************** */ | |
function change_role_name() { | |
global $wp_roles; | |
if ( ! isset( $wp_roles ) ) | |
$wp_roles = new WP_Roles(); | |
//You can list all currently available roles like this... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Remove the "Dashboard" from the admin menu for non-admin users ********************************** | |
** http://wordpress.stackexchange.com/questions/52752/hide-dashboard-from-non-admin-users ******* */ | |
/* !관리자 아닌 회원 알림판 제거 & 리다이렉트 *********************************************************** */ | |
function custom_remove_dashboard () { | |
global $current_user, $menu, $submenu; | |
get_currentuserinfo(); | |
if( ! in_array( 'administrator', $current_user->roles ) ) { | |
reset( $menu ); | |
$page = key( $menu ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Customize Toolbar ************************************************************************** | |
** http://www.sitepoint.com/change-wordpress-33-toolbar/ *********************************** */ | |
/* !어드민 툴바 커스트마이징 ******************************************************************** */ | |
add_action('admin_bar_menu', 'change_toolbar', 999); | |
function change_toolbar($wp_toolbar) { | |
/* 로고 제거 */ | |
$wp_toolbar->remove_node('wp-logo'); | |
/* 미디어 업로드 제거 */ | |
$wp_toolbar->remove_node('new-media'); | |
/* change 'Howdy,' */ |
NewerOlder