Modify custom post titles

Themes Forums Academy WordPress Theme Modify custom post titles

  • Author
    Posts
  • #39608

    habland
    Member

    Hi Themex

    Currently, in your Academy theme I’m adding an icon to post titles by category as follows:

    ==========

    add_action( ‘the_title’, ‘addLock’, 10, 2 );

    function addLock( $title, $post_id ) {

    if (! current_user_can(‘edit_posts’)) {

    if( has_category( 35, $post_id ) ) {

    $title = ‘<i style=”margin-right: 1px; color: #BEDB39″ class=”fa fa-lock” aria-hidden=”true”></i><span class=”title-1″> ‘ . $title;

    }}

    return $title;
    echo “</span>”;

    }

    ==========

    I’ve tried many variations using online examples, but I can’t seem to find the right way to filter in Academy custom post types (namely, courses and lessons).

    Any help modifying the above to filter for course and lesson post types would truly save me from madness!

    #39617
    themex
    themex
    Member

    You must be signed in and verified as a buyer of this theme to view replies by the support staff. Register Now →

    #39619

    habland
    Member

    Awesome, thanks; that works perfectly. Exactly what I was after :D

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

You must be logged in to reply to this topic.