• Resolved thunderknuckle

    (@thunderknuckle)


    I think I’m a little out of my depth here.
    I’m been learning HTML, CSS, PHP and wordpress for the last 6 months and I’m almost there.

    The issue I’m having is that I’ve designed a theme that uses a home.php file as the homepage and this file should essentially be a snapshot of what is going on across the website.

    It’s an independent record label so the front page has a quick featured news section, an events section and a list of some CDs too.

    here is the link to the site currently
    https://www.holmbushrecords.co.uk

    At the moment the releases (CDs) are hardcoded into the php file using standard div/css/html.

    What I’d like to be able to do is show a random selection of products in the same way that the shortcode [eshop_random_products] would do on a post or page created with the wordpress backend.

    I know that I cannot use shortcodes directly on the home.php file so I’m wondering if there is anyway of doing it or if people have any ideas about how they’d go about it.
    Ideally I don’t want to have to create a page template and use that as there are some elements on the home.php that can’t use shortcodes (the events section for example)

    Does this all make sense?

    I hope I’m not being stupid and missing something obvious here

    Apologies if I have

    Thanks in advance

    Chris

    https://www.ads-software.com/extend/plugins/eshop/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Anonymous User

    (@anonymized-3085)

    look up the WP function do_shortcode.

    Thread Starter thunderknuckle

    (@thunderknuckle)

    Thanks very much Elfin. it took a bit of muddling about with the syntax and placement but finally got it up and running on a xampp testing server on my laptop.
    It’ll go live soon

    so my solution was to use the do_shortcode thus…

    <?php echo (do_shortcode("[eshop_random_products panels='yes' imgsize='30' records='9' show='9']")); ?>

    That is written directly into my home.php file inside a div called homereleasescontent and is obviously stylable (sic?) with CSS

    Hopefully that’ll help someone else if they get the same problem

    Hey Thanks Thunderknuckle!!

    Your muddling about and finding the one-line solution saved me probably double muddling about. I followed Elfin’s advice and was knee deep learning how to write my own custom shortcodes (not needed for putting an existing short code in an eshop template) before I realized I was wasting my day. Then I ran across your post. Thanks again.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘attempting to use eshop with home.php’ is closed to new replies.