Get image from one page and show/add it on another page - php

We had one custom wordpress requirement that when we are adding images (for instance, a car image) on the homepage, any time after that, when creating a new page, that car image should appear on the right hand side by default. Thus, whenever I'm changing the homepage car image to some other image it will reflect on other pages also.
I'm using divi theme for reference. They are using a pagebuilder. We are adding the image in home page. I'm not using sidebar.
I have tried many plugins, but just unable implement this requirement.

You must delete the first, and then from the top delete add media button
then choose your image as you like.

Related

Link image to its product on WooCommerce /Woolentor Plugin

I'm building a website for the first time using WooCommerce. I have created a separate page for separate categories and I have added the category product using WooLentor Plugin (a plugin that works with Elementor editor). While the layout looks awesome, the only problem is that users need to click on the title only for it to redirct them to the product page. If they try to click on the image (which is more user friendly) they will not be redirected as the image url for some reason is (#).
Is there a way to automatically replay this (#) with the product link?
I really appreciate your help.
Here is a link to a page I need the image link to work on:
https://guay.cf/dresses
My apology if it takes a long time to load as I'm using free hosting from infinityfree.net
Here is how the image looks on Chrome element inspector:
enter image description here

Custom WordPress post types NO PLUGIN

So I been tasked with creating two custom post types for WordPress as an exercise. Was wondering what direction I should go with this. Check it out below:
Part 1
Create a custom post type called Products
A Product needs fields in the admin for Title, Link, Image, Background-color
Take each of the images from the product-images directory, and create a product from them.
Each one should have:
a different background-color
a different title
Display these Products on the home page, and make sure that it looks good in every screen size. You can refer to the screenshot called products, in the screenshots directory, to see how it should look.
Part 2
Create a custom post type called videos
A video only needs fields in the admin for Name, youtube-id
Take each of the videos listed in the text file videos-list and create a video from them.
On the home page, below the products section, create a new section and that shows only one video and a list of text links for the other videos. Refer to the screenshot called videos, also in the screenshots directory to see how it should look.
When you click the link to another video in the list, the video displaying on the home page should change and become the new video
Can anyone give me some direction on how to go about this. I understand how to create a custom post type. What I don't seem to get is how to create fields for a bg color and image. For the video section I am further confused as to how to actually create the section with links on the right and a video that changes to the left once the appropriate link has been clicked.
I'm not a WordPress guru by any means so any help on these 2 problems would be greatly appreciated.

How do I control individual images in Wordpress rather than the whole gallery of a post?

Say for example if I have 6 images uploaded to a gallery in a Wordpress post, is there a code I can insert into the single.php page for each individual image so I can control exactly where each image goes?
For example if I want 1 image before the title I could insert the code for 'image1' before the title, and then for another image to be after the title insert a different code for 'image2' and so on..
I've understood what you are trying to do. Here is the way how I do it:
Download WP plugin called Advanced Custom Fields.
Install and Activate it.
Go to WP Admin Dashboard -> Custom Fields.
Take a look at screenshot below:
Go to WP Admin Dashboard -> Posts. Create new or Edit existing one and you will see a new field under the editor. Upload your featured image there.
Finally go to your content-single.php and insert this part of the code about the title:
http://pastie.org/private/eox0tf13awpktmuejybnja
Enjoy!

How to create a thumbnails page in WordPress

I'm creating a WordPress photoblog theme and I want to create a thumbnails page that sits between index.php and single.php.
The idea is that when someone clicks on a blog post, they go to the thumbnails page to see all photos attached to that post and they then click on an individual image to be redirected to the blog entry. Does WP templating support this?
WordPress just loads the files inside of the theme's directory, so you aren't limited by WP much.
If you want, why not just make the index.php file have a section which runs only when it receives a $_GET variable denoting that the user has requested the thumbnails page?
This is sort of what I mean:
single.php:
<?php
if (isset($_GET['gallery']))
{
// Show the gallery.
} else {
// Show the main content instead
}
?>
And on index.php, you could add the gallery parameter to the URLs:
Title of Article
But that's just the way I'd do it.
I don't see what you mean by "the user clicks on a blog post", but in short, you could modify the main template to write a link like:
Show Photos
Then write some custom plugin to manage a set of photos per blog post.
Finally, create a page "showphotos" and assign it to a theme file and add the necessary PHP code to generate the thumbnails inside of it.
The problem with your question is that you're asking something similar to "how do I build a wooden tower"? There are different ways, and each depend on different use cases, none of which are specifically tackled by your question. Don't forget that we on SO are not here to create plugins for you, so don't ask for elaborate systems and instead focus on what's bugging you.

Wordpress Gallery Links

I have a Wordpress page which is showing gallery that I created by using Wordpress built-in post editor: into it here is its url: http://jalrosh.com/lylescenter/?page_id=8
Now the issue is that when I click on some image its big image opens in a new page and that is disturbing page design. It should come in the central area but it is appearing on the top of the remaining page.
There are several plugins that could help you do this. For example http://wordpress.org/extend/plugins/lightbox-2-wordpress-plugin/ I haven't used this plugin, but a wordpress plugin search for "lightbox" came with several options. Try some of them out and see what one you like best.
I haven't tried any of them but supposedly they should take any image and have it viewed via a lightbox (which is the correct term for having the image displayed over the existing page).

Categories