[Resolved] Adding Subtitle

Tagged: 

  • Author
    Posts
  • #8284

    eri-cat
    Participant

    Wondering if I could get some assistance with adding a subtitle to pages and posts? I have tried a few plugins but I don’t think the theme is built for subtitles. (I am hoping it can appear under the page title, above the featured image.) Thanks!

    #8285

    Andrew Misplon
    Keymaster

    Hi eri-cat

    Sure. How would you enter the sub-title? Where would that information be stored? You could perhaps install Advanced Custom Fields and setup a custom field that way. It would then require a child theme to render the field on the site front end.

    #8288

    eri-cat
    Participant

    Ok, I’ve downloaded the ACF plugin and I’ve started my child theme folder (I wasn’t using one before, only had been editing CSS) with a style.css and functions.php file.

    ACF
    Field Label: subtitle
    Field Name: subtitle

    Can you help explain which file(s) I will need to create in my child theme to display this field?

    Also, have I enqueued the parent styles correctly? New to this!

    <?php
    add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );
    
    function enqueue_parent_styles() {
       wp_enqueue_style( 'parent-style', get_template_directory_uri().'//puro-4401.kxcdn.com/style.css' );
    }
    ?>
    #8294

    Andrew Misplon
    Keymaster

    Hi 🙂

    Please, see my example: https://purothemes.com/wp-content/uploads/2017/11/ultra-child-acf-single-post-sub-title.zip.

    I only saw your field naming after this so just change sub_title in single.php in the child as required.

    Please, note that any changes you’ve made to the parent theme files will be lost if we release an update in the future and you run that update.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Scroll to top