Include Attachements Plugin in Theme (7 posts)

  1. jeffvand
    Posted 3 years ago #

    I am working on trying to include the attachements plugin as part of a theme package.

    1. I have added the whole "attachements" folder to my theme folder
    2. I've added the following to my theme functions file.

    //Include Attachements Plugin http://wordpress.org/extend/plugins/attachments/
    require_once dirname(__FILE__) . '/attachments/index.php';

    This shows up the attachements fine in the pages/posts at the bottom, but when I go to add a new attachement it pulls up the screen, I am able to select the image and the modal window closes but no attachment is shown on the page like it does when the plugin is just activated.

    I am wondering if it might have something to do with permissions as well. I am running this on a multisite setup where I have to set up permissions manually. Are there any special permissions that I need to think about? Thanks so much for your help or thoughts.

  2. jeffvand
    Posted 3 years ago #

    Ah, I did a bit more testing and found this javascript error.

    Uncaught ReferenceError: attachments_uniqid is not defined post.php:1228
    (anonymous function) post.php:1228
    T.each.T.forEach load-scripts.php:433
    r.(anonymous function) load-scripts.php:459
    (anonymous function) post.php:1225
    g.Events.trigger load-scripts.php:443
    f.extend._onModelEvent load-scripts.php:458
    g.Events.trigger load-scripts.php:443
    f.view.Toolbar.Select.f.view.Toolbar.extend.clickSelect load-scripts.php:476
    f.view.Button.f.View.extend.click load-scripts.php:476
    v.event.dispatch load-scripts.php:2

    I'm looking into this more... if anyone has any thoughts I'd love to hear them.

  3. Jonathan Christopher
    Plugin Author

    Posted 3 years ago #

    I would recommend not adding it as part of your theme and distributing it that way and instead instruct users to download and install Attachments as a plugin.

  4. jeffvand
    Posted 3 years ago #

    :( This theme is being added to a multisite network. I can't add the plugin to the network... is there no way to make this work as part of a theme. :(

  5. Jonathan Christopher
    Plugin Author

    Posted 3 years ago #

    It's just bad practice to pull a plugin from it's natural place and include it in a theme, sorry. You'll need to manually update every time the plugin is updated and that's just the tip of the iceberg. While technically yes it's possible, it's not something I'll be able to sponsor by outlining in detail here. I'm sorry to hear that some sort of red tape is preventing you from using Attachments, but it sounds like it's not the right solution for your project at this time. Have a good day.

  6. jeffvand
    Posted 3 years ago #

    Okay. Thanks Jonathan. I appreciate your feedback.

  7. Jonathan Christopher
    Plugin Author

    Posted 3 years ago #

    No problem, sorry to hear that you're in the situation you are, I'm not sure how to best suggest handling your want to include something like Attachments when you're not able to utilize a new plugin. If anything comes to mind I'll follow up on this thread.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Attachments
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.