WordPress.org

Ready to get started?Download WordPress

Forums

Ditty News Ticker
[resolved] Unable to show ditty news ticker via PHP direct function (12 posts)

  1. Carnage
    Member
    Posted 1 year ago #

    Hi, I am using the Montezuma theme and have created a ditty news ticker correctly. If I embed the shortcode on a page, in a widget it displays very well.
    If I take the php syntax and embed it in a php template it will not display.

    shortcode: [ditty_news_ticker id="356"]
    php direct function: <?php ditty_news_ticker(356); ?>

    http://wordpress.org/extend/plugins/ditty-news-ticker/

  2. metaphorcreations
    Member
    Plugin Author

    Posted 1 year ago #

    Can you provide a link to a page on your site that uses the direct php function?

  3. Carnage
    Member
    Posted 1 year ago #

    Hi, sorry I've had to set the site up live.

    If you to http://www.8thpillar.com/
    I have included a direct call in the header, main page area and footer
    Thanks

  4. metaphorcreations
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks. There wasn't anything I was able to tell by viewing the source or console. Could you email me your .php files (header, main, footer) where you have included it?

    joe[at]metaphorcreations.com

  5. metaphorcreations
    Member
    Plugin Author

    Posted 1 year ago #

    user: I don't know if this will be of use as the php code is actually in virtual templates that I access via WordPress admin
    I've copied and pasted the 3 page.php, header.php and footed.php into the attached file, but I'm guessing you may need more than this?
    Please let me know and I'll try search for the physical php file(s) on disk that contains these virtual templates.

    me:By virtual template do you mean you're editing by using Appearance > Editor and modifying the theme there?
    I testing that out and it seemed to work fine for me when editing through the dashboard.

    Are you sure you editing the correct theme? If you are using a child theme or something the file you are editing me be overridden by another file.

  6. Carnage
    Member
    Posted 1 year ago #

    Hi, thanks for checking.
    I am using Montezuma theme and I have edited the "Main" and "Sub Templates" within "Montezuma Options". Specifically the page.php Main Template and the header.php and footer.php Sub Templates.
    I've added the direct function three times just to get enough coverage to try figure out why it doesn't show the ticker.

    Is this sufficient information or do you need something further? So in summary, if you have a vanilla install of WP I would think if you install the ticker plugin only and then add the direct function into one or more of header.php, footer.php and page.php, that should be enough to prove if it's working and I have something else causing some contention?
    Thanks very much,
    Steven

  7. metaphorcreations
    Member
    Plugin Author

    Posted 1 year ago #

    I know the direct function works. It's what I use in the header here: http://dittynewsticker.com/. I've also used it many times on other projects I've done.

    It seems like it's an issue with your theme. I have never used the Montezuma theme, but, it sounds like the theme uses it's own implementation of a theme editor that may strip out php or something...

    What happens is you just insert the following:

    <?php echo 'This is a test to see if any custom php works; ?>

    You will probably have to contact the author of the theme to resolve this issue. There isn't anything "special" about the direct function used to call Ditty Ticker. It's just a basic php function that displays the ticker the same way the shortcode displays it. The shortcode actually calls the same function.

  8. Carnage
    Member
    Posted 1 year ago #

    Hi,
    I tried the following in the footer (tried with and without echo):

    <?php 'before';?>
    <?php ditty_news_ticker(357); ?>
    <?php 'after';?>

    and got the following output:

    'before' 'after'

    So I'm a bit baffled too. I'll keep thinking and post back if I have any better ideas.

  9. metaphorcreations
    Member
    Plugin Author

    Posted 1 year ago #

    If you did not include 'echo ' before the 'before' and 'after' you shouldn't have seen any output as the php would not have printed anything to the screen. Which means, that however your theme renders the edited files, it strips out the php tags and is just displaying what you put in as HTML, which is why my function isn't being called.

    You will either need to modify the theme via the Appearance > Editor screen in your dashboard or contact the theme author and see if they have any advice on including php with their custom editor.

  10. metaphorcreations
    Member
    Plugin Author

    Posted 1 year ago #

    It is possible, depending on what the theme does to render the file, that you can just put the shortcode in your edited file... and it may work. So, try just inserting the actual shortcode and see what happens.

  11. Carnage
    Member
    Posted 1 year ago #

    Hi, The shortcode just outputs the [ditty_news_ticker id="357"] as text on the page

    That's a good point about the echo and proves your point, so I'll dig further using the main Editor and see if that helps, rather than using these Templates which must do some additional rendering.

    Thanks for assisting

  12. metaphorcreations
    Member
    Plugin Author

    Posted 1 year ago #

    I'm marking this a resolved since the issue is not related to my plugin specifically... though, I'd be interested to find out what is causing the issue!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic