Community Forums › Forums › Archived Forums › Design Tips and Tricks › Placing Ditty News after the Header
Tagged: genesis_after_header
- This topic has 2 replies, 2 voices, and was last updated 7 years, 9 months ago by peterlaz.
-
AuthorPosts
-
December 6, 2016 at 5:17 am #197110peterlazParticipant
Theme : Enterprise pro
URL : http://plan2040.comI am using the Ditty News Ticker plugin to show message below the header. When I place the code from the plugin (<?php if(function_exists('ditty_news_ticker')){ditty_news_ticker(115);} ?>) in 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. I have placed 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;
}However, only the CSS customization appears in the ticker. The ticker message is not showing.
I contacted the plugin developer and he suggested to use the following code in the functions.php
function show_ditty_news_ticker() {
if(function_exists(‘ditty_news_ticker’)){ditty_news_ticker(115);}
}
add_action( ‘genesis_after_header’, ‘show_ditty_news_ticker’ );However, nothing shows up. He then suggested to use the following code to see if the the “action” being hooked into does actually exist..
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’ );I tried his suggestion. Again nothing shows up. He responded by saying
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."
https://wordpress.org/support/topic/showing-the-ticker-after-header-in-genesis-theme/#post-8519277
His final response is this "you may need to contact the Genesis team for help on this as I don’t use or know their framework".
My question: Why is it that when I place the php code in the hook it works but not in the functions.php file.
Please help.Thanks.
http://plan2040.comDecember 6, 2016 at 10:25 am #197119Victor FontModeratorThere 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?
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?December 12, 2016 at 9:51 pm #197500peterlazParticipantThanks Victor for the analysis.
Basically it is a silly mistake of mine. I updated your feedback to the plugin developers and they have resolved the problem.
This is their response
when you copy/paste the code from here the quote marks paste wrong (they paste as slanted single quotes), so I had to replace the single quotes in the pasted code manually and the code works as expected.
I am glad it is resolved now.
Thank you again for taking your time to response to my request for help.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.