• Resolved Ailar

    (@rehunubo)


    Hello!

    I would like to know how to I add random quote to my website to header below logo by replacing slogan (at the moment there’s random quote that uses Stray random Quotes, which are not updated)? What code should I put to theme’s header.php file?
    Stray Random Quotes uses this code: <?php if (function_exists('stray_random_quote')) stray_random_quote('all',false,'',false,1,0,'quoteID','ASC', false, ''); ?>

    I really like to show random quotes to my website visitors below logo.

    Thank you!

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • nsim2021

    (@nsim2021)

    Hi.

    That sounds like a great idea. It’s a great spot for random quotes.
    I don’t have a blog where I could test that out, and I don’t know php, but anyway, here’s a wild idea that might work.

    Install a plugin that will allow you to put shortcode from any widget anywhere in your blog. Here’s a post that describes how to do that:

    https://smallenvelop.com/find-widget-shortcodes-to-use-it-anywhere-in-wp-theme/

    Widget Shortcode seems to be designed to add your widget to pages and posts, but maybe it can work in the header, too. You will have to try.

    The Widget Shortcode plugin will create an Arbitrary area in your widget page. Drag your Random Quote widget into the Arbitrary area, so it won’t be seen on the front of your blog.

    Activate your Random Quote plugin and configure it the way you want in the Arbitrary area. Then grab the widget ID from Random Quote widget in the Arbitrary area, using the Widget Shortcode plugin, and the instructions on the page linked above.

    Add the widget to your php wherever you want it.

    https://smallenvelop.com/find-widget-shortcodes-to-use-it-anywhere-in-wp-theme/

    I hope this works, let us all know, because this is a really nice idea.

    Thread Starter Ailar

    (@rehunubo)

    This is the problem: widgets codes doesn’t work for me. All plugins have shortcodes for widgets areas, altough my area where I would like to add quotes are not widget area

    Thread Starter Ailar

    (@rehunubo)

    And also: I would like to use plugin that is up-to-date.
    Stray Random Quotes are really good plugin, unfortunately this hasn’t been updated for years now, so I have some problems with it. I want to replaced with another plugin that will make same.
    I found one and even test it, but that plgin only had widget shortcode and that doesn’t worked for me. I tried this one: https://wordpress.org/plugins/quotes-collection/

    So I took a screenshot about my page and I highlighted that area where random quotes will be placed with red. That’s not widget area.
    Screenshot: http://www.muleioleblogi.net/MEOB.png.

    I need plugin that has an opportunity to use shortcode like Stray Random Quote offered, it goes something like this:
    <?php if (function_exists('stray_random_quote')) stray_random_quote('all',false,'',false,1,0,'quoteID','ASC', false, ''); ?>

    I need something that will work non-widget area.

    PS! Sorry about my english, hope you guys understand me

    Thread Starter Ailar

    (@rehunubo)

    Hello again!

    No need any help, I got it. Thanks @nsim2021 . With the help of your mentioned second link I found this: https://smallenvelop.com/create-widget-area-in-wordpress-theme/

    And this one is working. I downloaded Quotes Collection again and I do not need any shortcodes

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Template-based shortcode’ is closed to new replies.