Viewing 4 replies - 1 through 4 (of 4 total)
  • hakelos

    (@hakelos)

    U can try change line 744 in SubmenuWalker.php

    $p->title = apply_filters( 'jcs/item_title', $p->post_title, $p->ID, $post_type );

    with

    $p->title = apply_filters( 'jcs/item_title', get_post_meta($p->ID, 'short_title', true), $p->ID, $post_type );

    Plugin Author ImportWP

    (@jcollings)

    Hi Billy,

    Thanks hakelos for providing this solution, i thought i would tidy it up just a little to save you from having to edit the plugin code.

    If you add the following into your themes function file and replace ‘short_title’ with the name of the post meta value, this has not been tested and written in the textarea (in theory it should work).

    function jcs_short_title($title, $menu_item_id){
    
    	$short_title = get_post_meta($menu_item_id, 'short_title', true);
    	if($short_title){
    		$title = $short_title;
    	}
    
    	return $title;
    }
    add_filter( 'jcs/item_title', 'jcs_short_title', 10, 2 );

    Hope this helps

    James

    Thread Starter Billy Levay

    (@wjlevay)

    Thanks to you both. Works great.

    Plugin Author ImportWP

    (@jcollings)

    Sorry about the previous lack of response, this ticket seemed to have slipped through the net.

    Glad you got it sorted in the end.

    James

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Replace page titles in submenu?’ is closed to new replies.