WordPress media querying? - php

I am using a WordPress 4.9.2 installation for a project which uses a custom gallery. What I would like to do is organize media by folders (which there are a few plugins for) and then query that media by folder/category so I can use it for the gallery. The approach I have found using web searches suggests you put the media inside of posts as attachments and then query those. This seems very unintuitive to me from the perspective of a user trying to change the gallery content. Is there a better solution than this?

Related

Exporting wordpress posts with gallery?

so I want to export WordPress posts to pdf or doc and I accomplished that using plugins like Aspose pdf/doc exporter, but I faced the problem previous it specialist uploaded images into gallery and because of that, those plugins can't find any pictures inside post and because of this my post gets exported just as simple text. Of course I can do it manually but that would take tons of my time so is there any way to accomplish this?

How do I integrate a program into Wordpress

I wrote a program that takes an array of images and forms a lightbox with some nice social bells and whistles. I would like to begin integrating it into WordPress but I have almost no experience developing WordPress other than a hello world plugin. I immagine there is a specific way Wordpress Prefers you do this. I am familiar with some of the wordpress API like $the_post and such.
My question is how can I pull the array of image urls from a WordPress gallery AND how can I add my onlick event to every image overriding whatever default action WordPress places on them?
A plugin is the preferred way to bundle WordPress functionality. You could add a hook that manipulates the output of the image gallery.
If this is not something you plan to share, you may be able to simply use JavaScript to manipulate the DOM and add your own actions/content.

Change in media library doesn't affect published articles

I'm running a WordPress blog with a lot of published articles and a lot of pictures in the media library. My question is:
Is there a way(plugin?) to make WordPress apply changes I made in the media library(e.g. changing the description/alt text of a picture) to already published articles containing that picture?
Each time a media is used by Wordpress on a template, its proper data (excerpt, etc.) sould be loaded.
Try to clean your cache to force Wordpress to reload the data.
Maybe the theme you use on your blog don't use the right fields to populate the alt text of the pictures. Semantically, it should be 'image_alt' and 'post_description'.

Php image resize/thumbnail approach for (Wordpress)

My goal is to create a website for a client that needs the site to be heavily based as image galleries.
I am making the site through Wordpress so the client can upload the pictures through the friendly wordpress admin panel and then the site will display a parent image for the gallery and several thumbnails (scrolling with Jquery).
My question is for advice on good ways to resize the images as thumbnails. Currently I have some "hack-ish" code that simply changes the image dimensions, but as far as I know this doesn't reduce loading time and is quite inefficient.
Any ides on how to do it better? Possibly by using PHP GD? Thanks!
Wordpress already does this on successful upload.
Besides creating the standard set of thumbnail, medium and large sizes, you can also enter custom sizes to create under the Settings -> Media section of the dashboard.
You can also add custom sizes in plugins and / or themes. See http://codex.wordpress.org/Function_Reference/add_image_size
Timthumb might be a good solution for this. The built-in wordpress media settings can only be set once for three different image options (thumbnail, medium and large). If you change the settings, anything already uploaded won't be readjusted. Most of the time this is acceptable, but for a photo heavy site, you might need more size options and dynamic adjustments. This simple php script will create any size image and save a cache copy for quick delivery. Lots of WordPress themes use it.
http://code.google.com/p/timthumb/
-- EDIT --
So, you know that advice about TimThumb I gave yesterday? Well, check out the big news today. Just make sure you're using the latest version.
http://ma.tt/2011/08/the-timthumb-saga/
WordPress his this nifty function tucked away image_resize, I'd recommend that if your looking to do this on the code size in one location. I have a small "library" I wrote to "help" with handling file uploads in WordPress, the git repo is here.

Using WordPress as piecemeal in existing site?

After some solid advice from people on here about using WordPress for a small (six page) website, I wanted to broach another question regarding using WordPress for a non-blogging site. Yet, I know my client would like to update various, but small portions of their site from time-to-time.
I won't be installing WP in the root, but a sub-directory and have all my core site files sitting in the root.
Here are my questions:
Can I include content from Pages in WordPress and output that content on any page outside of the WP install directory? Is there something specific I would need to include?
Do I have to use a Theme or can I still use my already built CSS?
I'd like to be able to use my own CSS for the site and not have it be tied to a Theme - is that possible? Meaning I use www.example.com/css/styles.css vs www.example.com/wp-content/themes/styles.css.
I also have a slider comprised of three DIVs for each panel, can I pull in that specific Page with that markup for the slider?
Can I also make my own queries for data as well?
Is there anything that I won't be able to accomplish or advise against doing?
I'm mostly concerned about having to use a Theme, mostly because I don't know if I'll need to use it or not.
Thanks for any help.
Lots of docs available:
http://codex.wordpress.org/Moving_WordPress#Giving_WordPress_its_Own_Directory_While_Leaving_the_WordPress_Index_File_in_the_Root_Directory
and
http://codex.wordpress.org/Integrating_WordPress_with_Your_Website , where you pull pages/posts from the WP loop into your existing design, CSS, etc.
You will need to link necessary JS files in the site.
http://codex.wordpress.org/Function_Reference/query_posts will show you how to make your own queries.

Categories