[Resolved] Ticker location PHP / Short code

Home Forums Support [Resolved] Ticker location PHP / Short code

Home Forums Support Ticker location PHP / Short code

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #844167
    tenchystryder

    Hi Guys

    I am using the Ditty News Ticker for my site. I am looking at placing it in the top bar.
    Is there a reliable way of adding either PHP or Shortcoding.
    I have tried adding custom HTML widget but it will not show the ticker. At the moment I have it showing it the top content area of the home page only.

    Here is the PHP that the Ditty plugin is giving me

    	
    <?php if(function_exists('ditty_news_ticker')){ditty_news_ticker(2563);} ?>
    #844168
    tenchystryder

    BTW – I have my addtoany social icons in top bar. I am not worried if I have to remove them for the styling. Also, not sure if the top bar GB color if affecting it. I have changed it to #ffffff but it still did not show the ticker

    #844370
    David
    Staff
    Customer Support

    Hi there,

    does the plugin provide a shortcode? if so that should work within a HTML widget.

    If not then you can use a Hook to add the php, but it would have to be above the top bar by using the before_header hook:

    https://docs.generatepress.com/article/hooks-element-overview/

    #844396
    tenchystryder

    Hi David

    Yes that worked thank you. Both with shortcode and PhP. I have used the PhP code in my first post.

    I have set site wide and all users in the hook as the login is disabled anyway (read only site no comments).

    Is there a way I can centre it, add padding, change colours etc ?

    #844397
    tenchystryder

    By the way, above header puts it between header and top bar, not over the top bar

    #844407
    tenchystryder

    Sorry, last post should read “before header”

    #844546
    David
    Staff
    Customer Support

    So in the hook element –> priority field set this to a lower number, i think 5 should do it, worst case change it to zero and it should appear above the topbar.

    Styling it with some CSS:

    .mtphr-dnt-tick-container {
        text-align: center;
        padding: 10px 0;
        background-color:#ffffff;
    }
    #844578
    tenchystryder

    Super dooper. That worked great thank you David.
    Decided to leave it where it is. Stands out a little better.

    I can mess about with it now 🙂

    Great work as always thanks

    #844582
    David
    Staff
    Customer Support

    You’re welcome

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.