• Resolved chris86

    (@chris86)


    I’m using the Random Quotes plugin in my sidebar-ext.php file. My quotes display at the very top of the sidebar, right above the “Categories” heading. How do I add a new heading into my sidebar-ext.php file?

    When I open the “sidebar-ext.php” file, it doesn’t list the “Headings” in the sidebar (i.e. Categories, Pages, Archives). The only code in sidebar-ext.php is a bunch of function calls.

    if ( function_exists(‘sem_newsletter_form’) )
    sem_newsletter_form();

    if ( function_exists (‘wp_quotes_random’ ) )
    wp_quotes_random();

    if ( function_exists(‘the_categories’) )
    the_categories();

    And so on…

    There’s no list of sidebar headings (archives, pages, recent posts, etc.). So, where do I create a new “Heading” for my Sidebar-ext? I want the new “Heading” to say “Random Quotes.”

    SPACING ISSUE…

    There’s also a spacing problem between the quotes that appear and the Translation icons at the top of the page.

    My quotes are ***right underneath*** the flags (for the translation function), but I want some spacing between the flags and the random quote. Any idea how to do this?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter chris86

    (@chris86)

    the spacing comes from the h2 tags. try:

    <h2>some title</h2>
    your code

    Thread Starter chris86

    (@chris86)

    Hi Denis-

    I inserted the code into my sidebar-ext.php file, and I got a syntax error that showed up on my site. Here’s the code I inserted into the sidebar-ext.php file…

    <h2> Random Quote </h2>
    //Random Quotes Plugin

    if ( function_exists (‘wp_quotes_random’ ) )
    wp_quotes_random();

    Again, I’m just trying to get a “Heading” formatted just like the “Categories” heading and the “Pages” heading. Why am I getting a syntax error? It doesn’t like the < > tags, apparently. Can I use HTML syntax within a PHP file?

    you’d need to do something like:

    ?><h2>Random quotes</h2><?php
    if ( function_exists ('wp_quotes_random' ) )
    wp_quotes_random();

    or:

    echo '<h2>Random quotes</h2>';
    if ( function_exists ('wp_quotes_random' ) )
    wp_quotes_random();

    Thread Starter chris86

    (@chris86)

    Awesome. That did the trick. No more syntax errors. From now on, I’ll be sure to use the ?> and <?php tags when embedding HTML inside a PHP file. Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Headings in Sidebar-ext and Random Quotes Plugin’ is closed to new replies.