- This topic has 8 replies, 2 voices, and was last updated 4 years ago by
David.
-
AuthorPosts
-
March 20, 2019 at 1:33 am #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);} ?>
March 20, 2019 at 1:34 am #844168tenchystryder
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
March 20, 2019 at 6:12 am #844370David
StaffCustomer SupportHi 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/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 20, 2019 at 6:31 am #844396tenchystryder
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 ?
March 20, 2019 at 6:32 am #844397tenchystryder
By the way, above header puts it between header and top bar, not over the top bar
March 20, 2019 at 6:43 am #844407tenchystryder
Sorry, last post should read “before header”
March 20, 2019 at 6:52 am #844546David
StaffCustomer SupportSo 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; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 20, 2019 at 7:24 am #844578tenchystryder
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
March 20, 2019 at 7:26 am #844582David
StaffCustomer SupportYou’re welcome
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.