display CPT next to post title

Home Forums Product Support Forums Ajax Search Pro for WordPress Support display CPT next to post title

This topic contains 11 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 3 years, 8 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #28698
    dklong57
    dklong57
    Participant

    Hello

    Can you advise the if there’s any Advanced Title Field so i can display CPT name next to the Title?

    For example:

    Post – ABC
    Book – ABC

    #28710
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    This knowledge base will help. There is no option, but a small custom code snippet.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #28723
    dklong57
    dklong57
    Participant
    You cannot access this content.
    #28728
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Sorry, there was an error in that code, please use this one:

    add_filter( 'asp_results', 'asp_show_the_post_type', 10, 1 );
    function asp_show_the_post_type( $results ) {
      foreach ($results as $k=>&$r) {
    		if ( isset($r->post_type) ) {
    			// Modify the post title
    			$r->title = get_post_type( $r->id ) . ' - ' . $r->title;
    		}
      }
    
      return $results;
    }
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #28731
    dklong57
    dklong57
    Participant
    You cannot access this content.
    #28732
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You are welcome.

    This documentation should help!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #28851
    dklong57
    dklong57
    Participant
    You cannot access this content.
    #28871
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Some product attributes might be custom fields, other can be taxonomy terms. Enabling the search in taxonomy terms feature will help then.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #28891
    dklong57
    dklong57
    Participant
    You cannot access this content.
    #28904
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    I see a few single character words in the terms, and I think changing this option may help: https://i.imgur.com/aTBmNXK.png

    If no change, can you please add temporary back-end and FTP access, so I can check the issue? Thank you!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #29044
    dklong57
    dklong57
    Participant
    You cannot access this content.
    #29063
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


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

You must be logged in to reply to this topic.