How do i build a 'free download' feature in my WordPress theme please?

8 replies
HI

How do i build a 'free download' feature in my WordPress theme please?

I would like it on the homepage for visitors to click download for a document that has further information about Wills, how to set up etc and important information.

Is it difficult to build this button and attach the download?

Im clueless how it would work

thank you
#build #download #feature #free #theme #wordpress
  • Profile picture of the author CyberSEO
    Just insert the following code into your index.php theme template (somewhere above "<?php if (have_posts()) : while (have_posts()) : the_post(); ?>"):

    PHP Code:
    <?php if (is_home()) { ?>
    <p align="center"><a href="http://www.yoursite.com/document.pdf">Click here to download the manual</a></p>
    <?php ?>
    Just don't forget to replace "http://www.yoursite.com/document.pdf" with the actual URL of your document file.

    If you want, the "Click here to download the manual" text can be replaced with any graphical image (button) of your choice.
    Signature
    CyberSEO Pro - the ultimate all-in-one autoblogging WordPress plugin, powered by OpenAI GPT-4, Anthropic Claude, Google Gemini Pro, Midjourney, DALL-E 3 and Stable Diffusion XL
    {{ DiscussionBoard.errors[6761097].message }}
  • Profile picture of the author Litherland
    thank you for this.
    right ok im completely new at html.

    <?php if (is_home()) { ?>
    <p align="center"><a href="http://www.yoursite.com/document.pdf">Click here to download the manual</a></p>
    <?php } ?>

    if my document is a word document does that work to go "http://www.yoursite.com/document.pdf"
    How do i connect the document to the link?
    Signature
    www.mywillsuk.co.uk UK Will Writing Service
    {{ DiscussionBoard.errors[6761113].message }}
  • Profile picture of the author CyberSEO
    What's the full name of your Word document file and where it is located?
    Signature
    CyberSEO Pro - the ultimate all-in-one autoblogging WordPress plugin, powered by OpenAI GPT-4, Anthropic Claude, Google Gemini Pro, Midjourney, DALL-E 3 and Stable Diffusion XL
    {{ DiscussionBoard.errors[6761180].message }}
  • Profile picture of the author Litherland
    im writing it today but it will be "Writing Your Will Check list" and it will be in My Documents folder, building it with Microsoft word
    Signature
    www.mywillsuk.co.uk UK Will Writing Service
    {{ DiscussionBoard.errors[6761195].message }}
    • Profile picture of the author CyberSEO
      Originally Posted by Litherland View Post

      im writing it today but it will be "Writing Your Will Check list" and it will be in My Documents folder, building it with Microsoft word
      Give it some name (say "manual.doc") and upload it on your site into the /wp-content folder. So its download URL will be the following: http://mywillsuk.co.uk/wp-content/manual.doc
      Signature
      CyberSEO Pro - the ultimate all-in-one autoblogging WordPress plugin, powered by OpenAI GPT-4, Anthropic Claude, Google Gemini Pro, Midjourney, DALL-E 3 and Stable Diffusion XL
      {{ DiscussionBoard.errors[6761245].message }}
  • Profile picture of the author Litherland
    Thank you for this information i will start to work on it
    Signature
    www.mywillsuk.co.uk UK Will Writing Service
    {{ DiscussionBoard.errors[6768172].message }}
  • Profile picture of the author jazbo
    I would suggest you ask for an email address before giving them the download, so you can build a list.
    Signature
    CONTENT WRITER. Reliable, UK-Based, 6 Years Experience - ANY NICHE
    Click Here For Writing Samples & Online Ordering
    {{ DiscussionBoard.errors[6768178].message }}
  • Profile picture of the author rosetrees
    I think you are over-complicating your problem. I don't think you really want to incorporate the download button into the theme, do you?

    I'm guessing you really want to place it in the text of your page (or post) or in a sidebar widget.

    It's probably best to start by turning your document into a .pdf (you can do this from within Word 2007/10. As cyberseo said, upload that to wp-content.

    The URL (address) of the document is then mysite.com/mydocument.pdf

    You can then insert that link into your home page by linking either text or a graphic. If you want to link a graphic, upload it using the media upload button (just above the toolbars in the editing area) and add the link in the image dialog box. If you want to link text, just highlight the text and click on the link button in the toolbar in the editing area (do this using the visual editor tab, not the html one.)

    If you want to add the link in a widget, use a "text" widget and add:
    <a href="/wp-content/mydocument.pdf">download here</a>

    Jazbo's right - it really would be better to set up a mailing list and offer the download after people have signed-up to your mailing list. Take a look at ImnicaMail, Aweber, GetResponse, etc. Some offer a free trial.
    {{ DiscussionBoard.errors[6768207].message }}

Trending Topics