WordPress.org

Forums

Ditty News Ticker
Limiting ticker to homepage (9 posts)

  1. Dan14
    Member
    Posted 11 months ago #

    Is it possible to limit ditty news ticker to display only at the homepage and not in all pages?

    https://wordpress.org/plugins/ditty-news-ticker/

  2. metaphorcreations
    Member
    Plugin Author

    Posted 11 months ago #

    Sure. I'm assuming you've place the direct function in your header.php or some other file? If so, wrap that code in:

    if( is_front_page() ) {
      // direct function code goes here
    }
  3. Dan14
    Member
    Posted 11 months ago #

    Thank you for your quick reply. My coding knowledge is fairly limited. It is in the header.php, yes. I followed what you suggested and it did not work. I am assuming I did not wrap it correctly. I typed the code and placed the direct function after the //. It widen the line of the streaming news ticker and reflected on all pages.

    My theme is twentyfourteen.

  4. metaphorcreations
    Member
    Plugin Author

    Posted 11 months ago #

    Put the direct function on the line below the //.
    The // makes anything after it a comment, so it is not actually code anymore.

  5. Dan14
    Member
    Posted 11 months ago #

    Thank you for the reply. It does not seem to work I tried pasting it in header.php and functions.php but it did not fix the issue. I am assuming I am doing it wrong. Can you please tell me exactly what to copy and where to place it? I am sorry for my lack of knowledge.

  6. metaphorcreations
    Member
    Plugin Author

    Posted 11 months ago #

    I can't say exactly where you should put it, but it needs to be in one of your template files and not the functions.php file. If you want a specific ticker to display in your header, you'd place the code in your header.php file... if you want it in your footer you'd place it in your footer.php file.

    This would be the exact code you'd use (you need to replace the ticker ID to one of your ticker ID's)

    <?php
    if( is_front_page() ) {
      if(function_exists('ditty_news_ticker')){ditty_news_ticker(776);}
    }
    ?>
  7. Dan14
    Member
    Posted 11 months ago #

    Thank you. I will give it a shot and let you know if it was resolved.

  8. Dan14
    Member
    Posted 11 months ago #

    It works!! I just changed 776 to the ticker ID I have. Thank you for your professional approach and perfect solution!!

  9. metaphorcreations
    Member
    Plugin Author

    Posted 11 months ago #

    You're welcome! Glad to help.

Reply

You must log in to post.

About this Plugin

  • Ditty News Ticker
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic