custom field background image - php

I have looked high and low for this, but can't seem to find an answer... I have a wordpress site that used custom fields and can upload images to it and basic copy in a tinyMCE, but I was wondering if there's a way to have it so that a user could upload a background image to wordpress, and then have it appear on the site in the area that's designated?
I'm using Advanced Custom Fields to upload / edit fields.
One idea I have, is to have it so that a calls an absolute url that a user uploads stuff to... but the problem is that if a user uploads down the line, wordpress would change the url of where things are uploaded. For example, img src="october2013/backgroundimage", 2 months down the line it would be img src="december2013/backgroundimage".
Is there a way I can designate the url an image is uploaded to in wordpress?
Thanks

I found a solution to this! Just put it as a background image to the url.... like this:
<div style="background-image:url(<?php the_field('headerimagegraphic');?>); background-repeat: no-repeat;">

Related

Can't see URL to specific image in wordpress

guys I want to send some photos to my friend but when I want copy specific photo URL from gallery, so I can copy just gallery URL no photo. Is there any way to change it to see URL for photo ? I attach some photos for better explain.
I tried to change permalinks in settings and also watched in gallery, but in gallery are no settings. But I found that gallery is using ModuloBox.
This is how is URL in gallery preview
Here you can see that URL is same like in gallery
And this is what I need (watch URL)
There is a share option in the top right of your gallery which generates a link for you:
https://www.flyingslovak.eu/galleries/slovakia/?guid=photography_gallery_5273&mid=8
Have you tried to open the image you want in the slider, then right clicking on the large image and choosing 'Open image on a new tab'? Not quite sure thats the right wording, but it is something like that.
In the new tab you get the URL for the image - something like www.example.eu/wp-content/uploads/2019/01/01.jpg

Problems with wordpress slider -> Cyclone2

I have a question about wordpress slider plugin Cyclone2.
Problem is that when I upload and add an image to slider, it outputs incorrect src url for img tag on site page, like adding slider width and height to image url..
Ex. I upload image Champagne-All-Bottles.jpg.
In admin panel image loads successfuly: /wp-content/uploads/2015/12/Champagne-All-Bottles.jpg
but on site page it adds a width and height to img url like: /wp-content/uploads/2015/12/Champagne-All-Bottles-1200x400.jpg
HTML admin panel(correct):
HTML output on site page(incorrect url):
This plugin probaly makes an 1200*400 picture copy of the one you are giving because somewhere in the settings you say that the slider should be 1200*400 pixels. So the plugin is transforming your picture to the dimensions of the slider. Is there somewhere in the settings of the plugin something where you can adjust the dimensions?
A lot of WordPress plugins do this, and even WordPress itself is doing this. Making different dimension copies of images you upload.
EDIT: I searched the plugin you are talking about and in I think in basic settings the "width" and "height" are there so you can change the dimensions. But one thing, all images uploaded will get the same dimensions, thats how this (and a lot of other) WordPress plugin works.
Note: if you set "Width Management" to fixed, the plugin probably stops resizing your image, can you give it a try?
-Resize Images?
-No, shut up!
#TotalCare, thank you for your help :)

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

Galleria, Adsense, and onLoad

(1) I am looking at image galleries and I would like to attach Adsense to my image gallery.. I found this Galleria image script and I'd like to add adsense to it. I have been looking around and asking questions but can't find anything.
(2) I'd like to load the images as the user scrolls down the page instead of all at once. I have no idea where to even get started with that.
Anyone done this or could do it?
http://galleria.io
What you could do is add to you list of images a transparent image (gif or png) and place your banner under the galleria controler/div. You can even have a custom image for the thumbnail so it doesn't appear you have an empty image in the list.
Having somehow the banner in the list directly will probably get your adsense account closed as at any display of your image/ad you'll request it from google and they don't allow excessive requests / page. But this would need a lot of tweaking w/galleria script.
Cheers

API Upload file in Wordpress

I am not sure if Wordpress has API to upload file but what I am looking for is very simple:
Context: I have another plugin that I need to modify so that user can upload file in the Admin area of that plugin
Solution:
1. Rewrite a new upload thru some specific path. This has nothing to do with Wordpress. I am fine doing this.
2. I prefer to use existing Media upload feature or some Wordpress upload API. I read this post but it was problematic because I want to change the text title of "Insert to Post" to "Finish Upload".
http://www.webmaster-source.com/2010/01/08/using-the-wordpress-uploader-in-your-plugin-or-theme/
Can anyone help? Prefer to go with #2 but just need to change the text. How do I change it when it is a fanbox appearing when image button is clicked? And the "Insert to Post" doesn't come out until the image is done uploading. The issue is how to trigger a function to change that text when fancybox is shown and image uploading completed!!?
I put Post id into url and it solves problem

Categories