테마 functions.php 에러 문의

안녕하세요. 문의드릴 내용이 있어서 글 남깁니다.

neve 테마로 홈페이지 만들고 있는데

넣고 싶은 기능이 있어서 검색으로 https://www.cosmosfarm.com/threads/document/28872 질문을 찾아서

  테마의    functions.php에 해당 구문을 복사해서   FTP로 올렸는데 에러가 났습니다.

<?php
/**
 * Neve functions.php file
 *
 * Author:          Andrei Baicus <andrei@themeisle.com>
 * Created on:      17/08/2018
 *
 * @package Neve
 */

define( 'NEVE_VERSION', '2.2.0' );
define( 'NEVE_INC_DIR', trailingslashit( get_template_directory() ) . 'inc/' );
define( 'NEVE_ASSETS_URL', trailingslashit( get_template_directory_uri() ) . 'assets/' );

if ( ! defined( 'NEVE_DEBUG' ) ) {
	define( 'NEVE_DEBUG', false );
}

/**
 * Themeisle SDK filter.
 *
 * @param array $products products array.
 *
 * @return array
 */
function neve_filter_sdk( $products ) {
	$products[] = get_template_directory() . '/style.css';

	return $products;
}

add_filter( 'themeisle_sdk_products', 'neve_filter_sdk' );

add_filter( 'themeisle_onboarding_phprequired_text', 'neve_get_php_notice_text' );

/**
 * Get php version notice text.
 *
 * @return string
 */
function neve_get_php_notice_text() {
	$message = sprintf(
		/* translators: %s message to upgrade PHP to the latest version */
		__( "Hey, we've noticed that you're running an outdated version of PHP which is no longer supported. Make sure your site is fast and secure, by %s. Neve's minimal requirement is PHP 5.4.0.", 'neve' ),
		sprintf(
			/* translators: %s message to upgrade PHP to the latest version */
			'<a href="https://wordpress.org/support/upgrade-php/">%s</a>',
			__( 'upgrading PHP to the latest version', 'neve' )
		)
	);

	return wp_kses_post( $message );
}

/**
 * Adds notice for PHP < 5.3.29 hosts.
 */
function neve_php_support() {
	printf( '<div class="error"><p>%1$s</p></div>', neve_get_php_notice_text() );
}

if ( version_compare( PHP_VERSION, '5.3.29' ) < 0 ) {
	/**
	 * Add notice for PHP upgrade.
	 */
	add_filter( 'template_include', '__return_null', 99 );
	switch_theme( WP_DEFAULT_THEME );
	unset( $_GET['activated'] );
	add_action( 'admin_notices', 'neve_php_support' );

	return;
}

require_once 'start.php';

require_once 'globals/utilities.php';
require_once 'globals/hooks.php';
require_once 'globals/sanitize-functions.php';

이게  neve 테마  functions.php 원본이고, 제가 찾은 아래 구문을 위에 functions.php 맨 아래에 넣어서 에러가 나서

중간에도 넣어보고 했는데 자꾸 에러가 납니다.

//어드민바에 메뉴보이게
add_action('admin_bar_menu', 'my_admin_bar_menu', 999, 1);
function my_admin_bar_menu($wp_admin_bar){
	if(!current_user_can('manage_options')){
		$wp_admin_bar->remove_node('my-sites');
		$wp_admin_bar->remove_node('site-name');
		$wp_admin_bar->remove_node('customize');
		$wp_admin_bar->remove_node('updates');
		$wp_admin_bar->remove_node('comments');
		$wp_admin_bar->remove_node('new-content');
		$wp_admin_bar->remove_node('edit');
		$wp_admin_bar->remove_node('kboard-setting-page');
		$wp_admin_bar->remove_node('popup-maker');
	}
	
	if(!is_user_logged_in()){
		// 로그인 버튼 추가
		$args = array(
			'id'	 => 'cosmosfarm-login-page',
			'title'	 => '로그인',
			'href'	 => '?page_id=171',
			'meta'	 => array('class' => 'cosmosfarm-login-page'),
			'parent' => 'top-secondary'
		);
		$wp_admin_bar->add_node($args);
		
		// 회원가입 버튼 추가
		$args = array(
			'id'	 => 'cosmosfarm-register-page',
			'title'	 => '회원가입',
			'href'	 => '?page_id=174',
			'meta'	 => array('class' => 'cosmosfarm-register-page'),
			'parent' => 'top-secondary'
		);
		$wp_admin_bar->add_node($args);
	}
	else{
		// 로그아웃 버튼 추가
		$args = array(
			'id'	 => 'cosmosfarm-logout',
			'title'	 => '로그아웃',
			'href'	 => wp_logout_url(site_url()),
			'meta'	 => array('class' => 'cosmosfarm-logout'),
			'parent' => 'top-secondary'
		);
		$wp_admin_bar->add_node($args);
		
		// 회원정보 버튼 추가
		$args = array(
			'id'	 => 'cosmosfarm-profile-page',
			'title'	 => '회원정보',
			'href'	 => '?page_id=176',
			'meta'	 => array('class' => 'cosmosfarm-profile-page'),
			'parent' => 'top-secondary'
		);
		$wp_admin_bar->add_node($args);
	}

 

워드프레스 에러 기술지원 서비스 전문가에게 맡기세요
좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기
좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기