Wordpress - Add multiple featured images dynamically - image

Multiple featured images
In Wordpress you can set a "featured image". I need to add multiple featured images dynamically.
Dynamically number of featured images
When I say dynamically I mean, for one post I might want 2 images and for the next one 6 featured images. The number is unknown.
Just loop them out, when done
When in the theme I just loop them out with a foreach loop. Featured images are stored as custom fields. This part I can handle.
A plugin might do it?
I know of http://wordpress.org/extend/plugins/multiple-post-thumbnails/ but here I need to deside the number of images from the start. My number is unknown.
Plugin, script or good articles are welcome.

I recently added a plugin to a wordpress plugin repository which simulates the need of dynamic multiple featured image. You can check it out here.
Any suggestion, pull requests, issues, and plugin recommendations are more than welcome! Interested can join the development at GitHub.

The answer was to use Advanced Custom Fields. It's very powerful plugin for adding custom fields of all kinds.
The addon "Repeater" did the trick.

Depending on how you're planning to use your featured images, you might be able to just add them as a gallery to your post/page. Then, you could use one of these snippets to access your gallery images on your listing and detail pages:
Snippet 1
Snippet 2
The biggest drawback to this method is that they aren't featured images by the strict WordPress definition, so any themes or functions that are depending on them won't exactly work right.

Related

Extracting the main product image from a ecommerce product page

I am looking for options to extract the main image from a product page on a retailer website, the problem is there are multiple images in a product page (related images) , one approach I thought would work would be to extract all the image links, download each one of them and compare the size of each of those images and consider the one has the largest size in terms of storage bytes as the one that is the main product image.
Obviously that would be a very inefficient approach , we know that most of the retailers use certain ecommerce platforms like magento , bigcommerce etc, the major ecommerce platforms are only handful , is it possible to detect the ecommerce platform and leverage the template provided by each one of them to precisely extract the main product image?
I know the approach would never be perfect , but I am looking an algorithm that would be mostly accurate about 80% or so , is it doable?
Do you have a list of retailers that you're looking to extract the images from? If so, then go through each retailer's site manually, look at its HTML, and create some code that would successfully extract the image from this particular retailer. If not, then I'm afraid you're out of luck - you could just grab the biggest image on the page, or use some other heuristic, but there's no guarantee that you're grabbing the actual product image.
The problem with creating some sort of generic utility is that each e-commerce platform has its own structure for displaying product images, and that structure could be changed with each site. For example, just because Magento usually structures its images in a certain way, doesn't mean you'll always see them that way - it's entirely up to the theme that's currently applied.
You can use simple dom html lib to extract html. In terms of magento, the product thumbnail image is the img tag inside "product-image" class on product page. You can extract it as a good sized thumbnail image.
If you know the retailers and image as well download it through a script and check the sizes in a foreach loop statement and save the biggest one.
Thanks

How to create a second frontpage in Joomla?

How to create a second (or more) front page in Joomla? (Joomla 3.1.5 here)?!
My dream website would be a website with several Homepages, but I haven't figured yet how to make it....
What I mean: for example if you have website on sports - you want a Homepage for: Hockey, Football and Basketball
- each with all 18 (or so) template positions, full page of Modules, etc....Exactly like it is on actual Front Page, but each on different topic....
How to do this?!
and how to get over 'question quality standarts' - everything is described above;
You need to create menu items, assign them to different templates, assign the modules et voilà.
Create the new featured menu items and filter them by category, assuming one is Hockey, Golf etc.
Then in the template manager, install your new template or create a new style for one of the templates based on your requirements, and assign the newly created menu item.
If you're looking for a howto, you might want to start from Joomla.org or google.
It's not a matter of quality, but of context. This is a developers site, not a Joomla usage forum.
Unless you have a total different requirements that what you have described, one way to achieve what you are after for in Joomla 3, is to create several featured articles menu-items with the category settings you want, and also configure your template to work the way you want, with the module positions and the module assignments.
There are also other custom content components, you may want to try, like k2, that offers a variety of options when creating blog layout pages.
And to add to Daniel Bottner's comment that under conditions, this was also possible even with J1.5.
similar simple example in J1.5:
example-page1
example-page2
'Riccardo Zorn' did answer this question pretty well.
What you basically wan't to do is to create a website with kind of a following structure.
site:
1: category 1 (sport x)
2: category 2 (sport y)
2.1: subcategory to 2(sport y ~ men)
2.2: subcategory to 2(sport y ~ women)
...
While each category would be a seperate menu as well as very likely a different template.
It is up to you to filter for the templates and menues which modules are shown there.
But you will have one basic entry point for the website.
No offense but what you want to do is basically default in joomla since at least version 1.6

Joomla module that displays articles' thumbnail and small description on rows and columns?

I'm having trouble finding a joomla module that displays articles on rows and columns, each article with a thumbnail and a title or a small description. For e.g. I want to put it on my first page with 3 columns and and 5 rows, for a travel agency website.
Does anyone know of such module? Could anyone help me find it?
If not, any idea of how I could build it? (very last resort)
Thanks!
Since native Joomla articles do not support thumbnails out of the box you are probably better off using a CCK to accomplish what you want. I know at least Zoo and K2 support images related to an item without any extra code and both have the ability to display content as you have described.

Exclude main image from Magento product gallery

I need to update my database of products to mark the "base" image of every product as Excluded. Some products have 1 image, some have more than 1. In each case one image is marked as being the Base, Small and Thumb image. In every case, where an image is marked as such, I need it to be excluded from the gallery.
Currently, without it being excluded, that image will show up twice in the lightbox gallery (Magento 1.4.0.1).
Does someone know the database structure well enough to give me a mySQL solution to update this?
I can manage future new products easily enough, but there's no way I'm running through 22000 products manually! :-)
Thanks in advance!
The SQL to do this in Magento 1.4.0.1 is:
UPDATE `catalog_product_entity_media_gallery_value`
SET Disabled = 1
WHERE Position = 1
I agree that updating the gallery code would have been a good/better solution, but in my case I am easily able to keep on top of this as new products are added in future.
It is easier to update your gallery code to exclude the first image you also do not have an ongoing need to update the product images.

Magento - Show same item with different colors underneath the item

i’m new to magento and was wondering if someone can help me.
i have a product that comes in multiple colors, but if i set it up as a configurable product it just gives the user the option of choosing a different color (but doesn’t show an image to him/her)
what i would like to do is have the other colors appear underneath just like up sells would (the same design)
if anyone can help me i would greatly appreciate it
Use the Simple Configurable Products extension by Organic Internet, as available for free on Magento Connect and your problem should be solved.
One way to accomplish this is to store images for each color of the project. With JS, you could auto-select color options on the page, and still make use of a configurable product for this purpose. You'll need to do significant template alteration to make this work.
Another approach is to use simple products (which you've already created in this case), and list them directly in the catalog. With Magento's cross-sell functionality, you can tag the products to each other and provide links between product pages for each color. Obviously, this involves more navigation for the user, but does allow you to manage each product independently.
Both of these methods will retain normal product relationships and track inventory for each color of a product, so they are preferable to solutions that involve hacking the framework.
Hope that helps!
Thanks,
Joseph Mastey

Resources