Skip to content
One Designs One Designs One Designs

Navigation Menu

  • Themes
  • Documentation
  • Plugins
  • Blog
  • Support
  • About
My Account
  • Log In

  • Register
  • Lost Password
Support Forums
  1. Home
  2. Support Forums
  3. Theme Support
  4. Enlightenment
  5. Post Title Function to Entry Content from Entry Header

Post Title Function to Entry Content from Entry Header

Viewing 4 posts - 1 through 4 (of 4 total)
  • August 16, 2017 at 7:08 pm August 16, 2017 #23016
    efflerek
    Participant

    Hello,

    I would like to move post title and postmeta to entry content.
    I don’t wanna have them in entry header.

    Can You help me?
    How to do it?

    August 18, 2017 at 10:05 pm August 19, 2017 #23021
    Daniel Tara
    Keymaster

    The post title and meta were not designed to be hooked there. It is possible but you will need to apply some custom code.

    First you need to create a child theme.

    In the child theme’s functions.php file add the following code:

    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 );

    Now upload the child theme and activate it. The post title and meta should have moved to the entry content area. If you made any modifications using the template editor you may need to move them manually from there.

    August 19, 2017 at 11:48 am August 19, 2017 #23023
    efflerek
    Participant

    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’ );

    August 19, 2017 at 7:25 pm August 19, 2017 #23024
    Daniel Tara
    Keymaster

    The line is missing an = sign. Should be:

    $hooks['enlightenment_entry_content']['functions'][] = 'enlightenment_child_the_title';
Viewing 4 posts - 1 through 4 (of 4 total)

Tagged: Entry Content, entry header, post meta, post title, theme options

You must be logged in to reply to this topic.

Useful Information

About Us

We craft beautiful free WordPress themes with advanced functionality. Our themes are licenced under GPL and completely free, which means you can use them in any way you like, whether it’s powering up your website, giving your blog a new look, using it for some other project or modifying and redistributing them.

Never miss another release!

Subscribe to our newsletter and we'll keep you updated with new theme releases and recommendations.

Our Social Media Profiles

  • Facebook

    Like our Facebook page
  • Twitter

    Follow us on Twitter
  • WordPress.org

    Visit our WordPress.org Profile

Useful Links

  • Development Blog
  • Release Cycle
  • Site News
  • Support Policy
  • Contact Us
Copyright © 2009 - 2025 One Designs Created with passion, caffeine, WordPress and Enlightenment Framework