Change the following code:
wp_enqueue_script( ‘ditty-news-ticker’ );
add_action( ‘genesis_after_header’, ‘ditty_news_ticker’ );
function your_awesome_code() {
if(function_exists(‘ditty_news_ticker’)){ditty_news_ticker(115);}
}
to:
function show_ditty_news_ticker() {
if(function_exists(‘ditty_news_ticker’)){ditty_news_ticker(115);}
}
add_action( ‘genesis_after_header’, ‘show_ditty_news_ticker’ );
Thank you for the support.
I tried the codes as suggested by you and now nothing is appearing.
Please help.
Thanks
Ok, you may need to contact the Genesis team for help on this as I don’t use or know their framework.
The modification I suggested would be the correct code to use if they actually have a custom action in their framework called “genesis_after_header”. This would trigger the “show_ditty_news_ticker” function which contains the news ticker embed scripts.
There should be no reason to add “wp_enqueue_script( ‘ditty-news-ticker’ );” as the plugin itself tells WordPress to load the scripts. Again, I don’t have much of any knowledge about the Genesis framework so they would be the best resource in resolving this issue.
One test you could do is to add this code and see if anything shows up:
function show_my_test_text() {
echo 'THIS IS MY TEST TEXT THAT SHOULD SHOW RIGHT BELOW THE HEADER';
}
add_action( ‘genesis_after_header’, ‘show_my_test_text’ );
… If this doesn’t show up on your site then the “action” you are hooking into does not exist.
I tried the test code and nothing shows up. Genesis uses hooks where you could plugin php codes or shortcode to be executed.
When I use the short code ([ditty_news_ticker id=”115″]) or Direct Function (<?php if(function_exists(‘ditty_news_ticker’)){ditty_news_ticker(115);} ?>) in the genesis_after_header HOOK, ditty news works flawlessly.
However, I would like to embed the php code into the functions.php file for easy management.
For now I am using the following code in the functions.php file
add_action( ‘genesis_after_header’, ‘ditty_news_ticker’ );
function your_awesome_code() {
if(function_exists(‘ditty_news_ticker’)){ditty_news_ticker(115);}
}
And in the style.CSS I am using
.mtphr-dnt-tick-contents {
height:30px !important;
margin-left: 382px;
margin-right: 382px;
font-size: 18px !important;
font-weight: 600;
color: #fff;
padding-bottom: 5px;
background: red !important;
}
Only the CSS customization appears in the ticker. The ticker message is not showing.
I will post the issue in the Genesis forum for a feedback and update you once I get an answer.
Thanks
Ok, let me know what you find out. I wish I could view the Genesis documentation to help you out more but they hide that unless you have an account with them.
Based on the way hooks work, though, I’m not sure how your current setup is working. If the ticker embed code is placed within this function:
function your_awesome_code() {
if(function_exists(‘ditty_news_ticker’)){ditty_news_ticker(115);}
}
‘
Then “your_awesome_code” should be what is added the the action, like:
add_action( ‘genesis_after_header’, ‘your_awesome_code’ );
This tells WordPress to call the “your_awesome_code” function when the “genesis_after_header” fires. And when the “your_awesome_code” function runs, that is when your news ticker embed gets called.
When you have:
add_action( ‘genesis_after_header’, ‘ditty_news_ticker’ );
The action is calling the global ditty_news_ticker() function directly, without any parameters. It should not cause an error, but it shouldn’t display anything either since there isn’t a ticker ID included in it.
Anyways, let me know what you find out from Genesis. I’m interested to hear their response.
Thanks!
This is the feedback I received from studio press;
There doesn’t seem to be anything wrong from the Genesis side. The ditty news ticker wrappers are being generated in the genesis_after_header area. You can see them in the source code after nav primary when viewed in the browser. Are you calling the right content?
Here is a guide on genesis hooks.
http://wpsites.net/genesis-hooks/
It is really very silly of me to make such an elementary mistake.
I am glad it is resolved now.
I have also updated the studiopress forum on this matter.
Sounds good. Sometimes it’s the smallest things that are the most difficult to figure out!
Moderator
Jan Dembowski
(@jdembowski)
Forum Moderator and Brute Squad
@metaphorcreations I’ve deleted your offer to login to your user’s site. I’m am 100% sure you mean well but please never ask for credentials on these forums.
https://make.wordpress.org/support/handbook/forum-welcome/#the-bad-stuff
Now for the why: The internet is a wonderful place full of very nice people and a few very bad ones. I’m sure everyone here is very nice however, by giving some ones keys to your house you are trusting they wont steal anything. Likewise the person who takes the keys is now responsible for the house FOREVER.
If something was to go wrong, then you the author may well legally become liable for damages, which they would not normally have been as their software is provided without warranty.
Please be aware that repeatedly asking for credentials will result in us asking you to repeatedly stop before escalating up to the plugins team.