Hi guys i am stuck a bit, forgive my ignorance:) I have this:

add_action ( 'category_edit_form_fields', function( $tag ){
        $cat_title = get_term_meta( $tag->term_id, '_pagetitle', true ); ?>
        <tr class='form-field'>
            <th scope='row'><label for='cat_page_title'><?php _e('Category Page Title'); ?></label></th>
                <input type='text' name='cat_title' id='cat_title' value='<?php echo $cat_title ?>'>
                <p class='description'><?php _e('Title for the Category '); ?></p>
        </tr> <?php
    add_action ( 'edited_category', function( $term_id ) {
        if ( isset( $_POST['cat_title'] ) )
            update_term_meta( $term_id , '_pagetitle', $_POST['cat_title'] );

So creating custom field on edit category admin page. Now i am trying to call this custom title here like this: echo '<div class="category-title">' . $cat_data['cat_title'] . '</div>

Doesn't work for me. Please help?

Thanks a lot!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.