Jump to content
Sign in to follow this  
shannoga

Customize plugin functions.php is not taking effect

Recommended Posts

shannoga    0
shannoga

Hi I am trying to add custom post type to function.php in the Customize plugin.

add_action('init', 'alon_register');
	
	function alon_register() {
	
		$labels = array(
			'name' => _x('?????•? ?™??', 'post type general name'),
			'singular_name' => _x('?????•?? ???—?“', 'post type singular name'),
			'add_new' => _x('?”?•???? ?????•?? ?—?“?©', 'portfolio item'),
			'add_new_item' => __('?”?•???? ?????•?? ?—?“?©'),
			'edit_item' => __('?????•?? ?????•??'),
			'new_item' => __('?????•?? ?—?“?©'),
			'view_item' => __('?¦?¤?” ?‘?????•??'),
			'search_items' => __('?—?¤?© ?????•? ?™??'),
			'not_found' =>  __('Nothing found'),
			'not_found_in_trash' => __('Nothing found in Trash'),
			'parent_item_colon' => ''
		);
	
		$args = array(
			'labels' => $labels,
			'public' => true,
			'publicly_queryable' => true,
			'show_ui' => true,
			'query_var' => true,
			'menu_icon' => get_stylesheet_directory_uri() . '/article16.png',
			'rewrite' => true,
			'capability_type' => 'post',
			'hierarchical' => false,
			'menu_position' => null,
			'supports' => array('title','editor','thumbnail')
		  );
	
		register_post_type( 'alon' , $args );
	}
	
	 

The code is working great when I am moving the code to the "functions.php" in the pagelines theme. All other fiels are working well (css custom pages etc.). What could be the problem? Thank you Shani

Share this post


Link to post
Share on other sites
Simon    247
Simon
The code works if you put it into the base child theme. The customize plugin probably gets included too late. BTW you have two add_action lines in your code.

Share this post


Link to post
Share on other sites
shannoga    0
shannoga
Do you say that I can not use it to add those without base theme ?

Share this post


Link to post
Share on other sites
Jenny    33
Jenny
I believe what he said is that it's not working because it's not loading soon enough in the theme files. Enabling the base theme is essentially the same thing as customize. Just move all your custom code over.

Jenny :: Web designer at Simple Mama (follow me at @simplemamacom)

Check out Share Me, a social sharing add-on for DMS that is super simple to set up.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×