• Resolved raha1988ab

    (@raha1988ab)


    Hi
    First of all thanks for developing this plugin, I write review last week for that.

    I’m using secondary-title and in settings I can use HTML code so I used the br tag to separate my first and second title

    Now in your plugin I don’t see the second title , it shows the first title
    Would you please tell me how to fix this or give me a css or js code ?

    Thanks

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Benaceur

    (@benaceur)

    how a second title? could you clarify your question, with a picture for example.

    Thread Starter raha1988ab

    (@raha1988ab)

    Hi @benaceur
    Happy new year
    I forgot to link that plugin, the secondary title is plugin that add fields to post types
    This is the image of how its working: https://prnt.sc/269o2oq

    Thanks

    Plugin Author Benaceur

    (@benaceur)

    1- edit this file: wp-content/plugins/news-ticker-benaceur/get-news.php
    and replace the line 15:

    $filter_title_ntb = apply_filters( 'ntb_title_filter_ben', $ntb_nm_expt_t, $args );
    by:

    $filter_title_ntb = apply_filters( 'ntb_title_filter_ben', $ntb_nm_expt_t, $args, $recent_ntb );

    2- Put this code in the file “functions.php” of your current theme:

    add_filter( 'ntb_title_filter_ben', function ( $title, $args, $recent_ntb ) {
    $has_secondary_title = function_exists( 'has_secondary_title' ) ? has_secondary_title($recent_ntb["ID"]) : '';
    $get_secondary_title = function_exists( 'get_secondary_title' ) ? get_secondary_title($recent_ntb["ID"]) : '';
    return $has_secondary_title ? $get_secondary_title .': '. $title : $title;
    }, 10, 3 );
    Thread Starter raha1988ab

    (@raha1988ab)

    Hi @benaceur
    Thank you for instruction ,

    It’s working but I need some modification on it:
    is it possible to show the title and second title not in row ?
    I want to show them with Brake Line , `<br /> but now it shows the text in 1row. Even I used the br tag in Secondary title plugin , but in Your plugin it’s not braking line.

    Thanks

    Plugin Author Benaceur

    (@benaceur)

    I designed it like that every title in a line is better, so if you want to reverse it:
    1- edit the file “wp-content\plugins\news-ticker-benaceur\style-anim\inc \scripts_1-0-2.js” and delete between “// ellipsis” and “// ellipsis”

    2- replace the code you have pasted in “functions.php” by:

    add_filter( 'ntb_title_filter_ben', function ( $title, $args, $recent_ntb ) {
    $has_secondary_title = function_exists( 'has_secondary_title' ) ? has_secondary_title($recent_ntb["ID"]) : '';
    $get_secondary_title = function_exists( 'get_secondary_title' ) ? get_secondary_title($recent_ntb["ID"]) : '';
    return $has_secondary_title ? '<p class="ntb14444l6gh"> '.$get_secondary_title .'</p><p class="ntb14444l6gh2">'. $title .'</p>' : $title;
    }, 10, 3 );

    3- in the plugin settings put this in “Style customization (css)”

    .ntb14444l6gh {margin-top:18px !important;}
    .ntb14444l6gh, .ntb14444l6gh2 {line-height: 8px !important;}

    and adjust according to your current theme.

    -4 in the plugin settings in “Settings of style” change Height,Raise or lower the text (line-height),height (Title),Raise or lower the title (line-height) to 80 and in “Enable style of mobile (recommended)” change Height,Raise or lower the text (line-height) to 80.

    finally clear the cache, and the browser cache “Ctrl+f5”

    • This reply was modified 2 years, 10 months ago by Benaceur.
    • This reply was modified 2 years, 10 months ago by Benaceur.
    Thread Starter raha1988ab

    (@raha1988ab)

    Hi and thank you for these instructions
    I really appreciate it
    I think I could not get it right , So please see the image :Second Title separated with <br/> from the title

    I want to show my news in ticker like this , means : the second title is up and the title in down of the second title , with this I separated them from each others.

    Thank you.

    Plugin Author Benaceur

    (@benaceur)

    I understood you correctly, apply what I gave you and you will have the same result, with <p> you will have the same result as <br> (the second title is up and the title in down of the second title ).

    Thread Starter raha1988ab

    (@raha1988ab)

    Hi @benaceur
    Thanks for all of modification
    You was correct , I see the changes now , it needs to clear cache

    If the plugins updated , all those changes will remove , What should I do?

    Plugin Author Benaceur

    (@benaceur)

    just update the plugin (now 3.1.2) then add this line:

    add_filter( 'ntb_filter_enable_ellipsis', '__return_false' );

    above this code (previous):

    add_filter( 'ntb_title_filter_ben', function ( $title, $args, $recent_ntb ) {
    $has_secondary_title = function_exists( 'has_secondary_title' ) ? has_secondary_title($recent_ntb["ID"]) : '';
    $get_secondary_title = function_exists( 'get_secondary_title' ) ? get_secondary_title($recent_ntb["ID"]) : '';
    return $has_secondary_title ? '<p class="ntb14444l6gh"> '.$get_secondary_title .'</p><p class="ntb14444l6gh2">'. $title .'</p>' : $title;
    }, 10, 3 );

    plus the css certainly.

    Thread Starter raha1988ab

    (@raha1988ab)

    Hi @benaceur

    With do respect sair , I have exllent filing about your plugin becase you are update it continusly

    I have to add this code in my function or in plugin files?
    add_filter( 'ntb_filter_enable_ellipsis', '__return_false' );

    Thanks

    Plugin Author Benaceur

    (@benaceur)

    don’t touch the plugin, add the line to your theme’s functions.php with this code certainly:

    add_filter( 'ntb_title_filter_ben', function ( $title, $args, $recent_ntb ) {
    $has_secondary_title = function_exists( 'has_secondary_title' ) ? has_secondary_title($recent_ntb["ID"]) : '';
    $get_secondary_title = function_exists( 'get_secondary_title' ) ? get_secondary_title($recent_ntb["ID"]) : '';
    return $has_secondary_title ? '<p class="ntb14444l6gh"> '.$get_secondary_title .'</p><p class="ntb14444l6gh2">'. $title .'</p>' : $title;
    }, 10, 3 );
    Thread Starter raha1988ab

    (@raha1988ab)

    Sure ,
    You are on of the best plugin author that I have seen in my entire life.
    I want to participate for translating this amazing plugin for Persian language. would you please tell me what should I do?
    Thank you so much.

    • This reply was modified 2 years, 10 months ago by raha1988ab.
    Plugin Author Benaceur

    (@benaceur)

    Sorry for the late reply, you can translate via this link:
    https://translate.www.ads-software.com/projects/wp-plugins/news-ticker-benaceur/dev/fa/default/
    Once the translation is complete, notify the WordPress team for approval, via:
    https://make.www.ads-software.com/polyglots/

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘secondary title not show’ is closed to new replies.