Home › Support Forums › Theme Support › Enlightenment › Post Title Function to Entry Content from Entry Header › Reply To: Post Title Function to Entry Content from Entry Header
Thanks for very fast answer and help.
When I try to activate my theme it shows this communicate:
Fatal error: Cannot use [] for reading in /wp-content/themes/enlightenment-child/functions.php on line 54
Now, my functions.php looks like that. I bolded 54′ line.
<?php
// Exit if accessed directly
if ( !defined( ‘ABSPATH’ ) ) exit;
// BEGIN ENQUEUE PARENT ACTION
// AUTO GENERATED – Do not modify or remove comment markers above or below:
if ( !function_exists( ‘child_theme_configurator_css’ ) ):
function child_theme_configurator_css() {
wp_enqueue_style( ‘chld_thm_cfg_child’, trailingslashit( get_stylesheet_directory_uri() ) . ‘style.css’, array( ‘enlightenment-theme-stylesheet’ ) );
}
function enlightenment_child_the_title() {
$args = enlightenment_the_title_args();
the_title( $args[‘before’], $args[‘after’] );
}
function enlightenment_child_remove_entry_hooks() {
remove_action( ‘enlightenment_entry_header’, ‘the_title’, 10, 2 );
if( ! is_page() ) {
remove_action( ‘enlightenment_entry_header’, ‘enlightenment_entry_meta’ );
}
}
add_action( ‘wp’, ‘enlightenment_child_remove_entry_hooks’, 9 );
function enlightenment_child_add_entry_hooks() {
add_action( ‘enlightenment_entry_content’, ‘enlightenment_child_the_title’ );
if( ! is_page() ) {
add_action( ‘enlightenment_entry_content’, ‘enlightenment_entry_meta’ );
}
}
add_action( ‘wp’, ‘enlightenment_child_add_entry_hooks’, 8 );
function enlightenment_child_remove_teaser_entry_hooks() {
if( ! current_theme_supports( ‘enlightenment-grid-loop’ ) || ! enlightenment_is_lead_post() ) {
return;
}
remove_action( ‘enlightenment_entry_header’, ‘the_title’, 10, 2 );
}
add_action( ‘enlightenment_before_entry’, ‘enlightenment_child_remove_teaser_entry_hooks’, 6 );
function enlightenment_child_add_teaser_entry_hooks() {
if( ! current_theme_supports( ‘enlightenment-grid-loop’ ) || ! enlightenment_is_lead_post() ) {
return;
}
add_action( ‘enlightenment_entry_content’, ‘enlightenment_child_the_title’ );
}
add_action( ‘enlightenment_before_entry’, ‘enlightenment_child_add_teaser_entry_hooks’, 5 );
function enlightenment_child_entry_hooks( $hooks ) {
$hooks[‘enlightenment_entry_content’][‘functions’][] ‘enlightenment_child_the_title’;
return $hooks;
}
add_filter( ‘enlightenment_entry_hooks’, ‘enlightenment_child_entry_hooks’, 6 );
function enlightenment_child_template_functions( $functions ) {
$functions[‘enlightenment_child_the_title’] = __( ‘Post Title’, ‘enlightenment’ );
return $functions;
}
add_filter( ‘enlightenment_template_functions’, ‘enlightenment_child_template_functions’, 6 );
endif;
add_action( ‘wp_enqueue_scripts’, ‘child_theme_configurator_css’ );