Placing Text-Container over Image using php Wordpress - php

I want to program a plugin that sets a Text-Container over a Image in Wordpress. Im using the Divi Themen. My idea: I need to find where Images are rendered and add my container where I place my text with something like "get_meta_data()". The needed field are already in the media library. I just need to find how to create the conainer and place it over every image where my text exists. Any Ideas/Tipps?

Related

WordPress: Can you add an Excerpt on a PDF

Is it possible to add an Excerpt on a PDF document. Whenever I use the search function on my website I can see the PDFs results, but the text below the link says "No excerpt available". I tried adding text into the Description and Caption fields, but it did not work.
I tried going through the media library > clicking the file > Edit more details then when the file document opens I clicked on the Share Options at the top of the page, but there is no Excerpt option available.
I can see the Excerpt option in Pages and Posts, but not on PDFs.
Is there a way to add Excerpts to PDF documents?
Thank you.
I do not know of any plugins nor native way to do it but I had a similar problem on one of my last projects and here are my solutions.
Either... Creating a child post dedicated to that pdf and copying the content, outputting the child post content onto the parent post.
Or... Simply adding a description to the uploaded media (here the pdf) and outputting the description onto the post.
I went for the second one for dev time restriction, but the first one was also pretty cool because we could add long format additional information linked to the pdf.
Hope that will help!

Can I add items to the media library of wordpress without upload?

My wordpress site is hosted on the openshift,and when I edit my site's code and push code to openshift,my file that upload to wordpress will be deleted,so I use some public image storage serves to save my image.But there are some function in wordpress must use the media library...So I want to add the image to the media library by url without upload..What should I do?thanks
p.s:I can edit the code of my wordpress site
Try some plugin like this one: https://wordpress.org/plugins/import-external-images/
It's the first i've found, i've never used it before, so look if there's something better.

Drupal 7: How can I link uploaded images (via an image field) to specific URLs contained in a text field?

I need to link individually uploaded images (via an image field) to different external URLs (e.g. Link one image in one post to a website outside of my own). I've found modules that allow me to link image fields to nodes within my drupal site, but nothing that allows me to link uploaded images individually to different urls. That said, I figured I could create a text field, input a URL there, and set my Image Field in views to be linked to the contents of that field. E.g. Destination: [field_link_image_to]
However that doesn't seem to be do-able either. Any suggestions as to how I can go about doing this?
Use Link field module (https://www.drupal.org/project/link). After enabling add this field to the same content which contains the image you want to link to specific URLs.
Create a view then include both image field and link field url (you will get the exact URL which you will enter into the link field) then add custom text and create your html accordingly.
Let me know if it works or you want something else.
Thanks.

Drupal 7:replace original image with ImageStyles generated image

I'm using regular imagefields on various content types in a Drupal 7 social website (and also on the user profile pictures via http://drupal.org/project/imagecache_profiles). For cropping I'm using http://drupal.org/project/imagecrop as an image style effect.
I would like to replace the original image with the one generated from the imagecrop style. How do you replace the original image from a user (the one that gets used for subsequent image styles when you say call it in views) with one that is created from an image style effect?
I'm not sure the best way to approach this problem, which is why I posted question.
To make sure I'm being clear -
A User uploads a large image (say 2,000 pixels by 1300 pixels) via a regular imagefield.
Using image styles, I perform some effects (specifically javascript crop, but this could be generic) and then replace the original image with the one generated from the image style.
All additional image styles (different sizes etc) use the new original images and are derived from it.
I think this can be done easily using a custom module and they must have used something like the image editor project - See drupal.org/project/imageeditor, just not sure what hooks to use or how to jump in on this. Any advice, tips or direction would be great.
Check module - Original image with style
I believe you can address your problem by making changes under the display settings for your field:
/admin/structure/types/manage/[your content type machine name here]/display

Wordpress - Dynamically Process Image

I have images uploaded in the media library in WordPress. I would like to show the images with text composited on top of them using PHP's GD or something similar.
If this were just a plain old PHP site, I could create a URL with a search parameter for the text and center it over my image with GD and serve it up. In WordPress, I am a little unclear how to accomplish this. I am not sure if it fits well into the concepts of Posts and Pages.
I can perform the programming myself. I am just looking for some pointers on how to get started.
Thanks,
Carl
You can do that in WordPress, too. It's mostly just a plain old PHP site. For example, you could create a PHP file that creates the composite given the text and the image and use it like: <img src="/composite.php?image=...&text=...">.
Maybe all of the images are on a particular page or post type. Then you could create a custom page or post-type template that parses the $post->post_content for the images, does the compositing, and alters the image tags to point to the new composited images.
Or, more generally in that vein, create a filter for the_content that does that for all posts.
You might be able to hook into the WordPress upload system. As images are uploaded, you could create the composite. The wp_handle_upload filter might work for that.
Or you could even create a WordPress cron job that scans the media uploads for new entries and creates the composites then.

Categories