Does Revolution Slider work on Wordpress mulitsite? - multisite

Does Revolution Slider work on Wordpress mulit-site?
-Chad

Find function mfn_get_sliders in functions/meta-functions.php and replace
$table_name = $wpdb->base_prefix . "revslider_sliders";
with:
$table_name = $wpdb->prefix . "revslider_sliders";
After this sliders will show properly under multi-site installations.

Related

In Woocommerce for Unisex Product: How can I Show A Different Image Based on Men Or Women Category Selection

Many of my products are unisex, how can I display my male mockup images for unisex products listed within the "Men's T-Shirts" category and vice versa for women? Ideally the image would be pulled from the image gallery of the product so the male & female image would be the the 2nd & 3rd image within the product image gallery.
I found a code that allows for displaying different images from the shop page vs the single product page but I can't seem to figure out the code to base it on a "if within cateogry" calling. This is the code:
add_filter('woocommerce_single_product_image_thumbnail_html', 'remove_featured_image', 10, 2); function remove_featured_image($html, $attachment_id ) { global $post, $product; $featured_image = get_post_thumbnail_id( $post->ID ); if ( $attachment_id == $featured_image ) $html = ''; return $html; }
And was playing with this code to select the image from the gallery:
$attachment_id = $product->get_gallery_attachment_ids()[0]; echo "<img src='" . wp_get_attachment_url( $attachment_id ) . "'>";
I'm not sure if I'm playing with the right code. I would appreciate any help.
Jane
You can use a simple, no code solution.
Create a separate products for men and women, then use a plugin like: https://www.wooextend.com/product/group-stock-manager-shared-stock-woocommerce/
to connect both products so they share the same stock. This way you can add separate images and categories but when "men" product is bought, the stock of "women" product will decrease too. Very simple and effective.

Product Image not showing on Home Page

Basically, Product image on showing.
i try this method as given below. after product image appeared , banner background picture stop to showing.
Open PluginListGenerator.php file located at vendor/magento/framework/Interception.
Replace the line
$cacheId = implode('|', $this->scopePriorityScheme) . "|" . $this->cacheId;
with below:
$cacheId = implode('-', $this->scopePriorityScheme) . "-" . $this->cacheId;
Save the PluginListGenerator.php file.
I have try this code, problem solved but after that banner image not showing.

Adding different thumnail sizes to products in magento

I have a magento store that sells glasses, clothing etc. The problem is that i would like my glasses to have thumbnails that are say 300px X 100px and the clothes to have thumbnails that are 300px X 300px.
I can think of a few different routes I might take but I am unsure of the implications each route would have on the upgradeablity of my store. (currently using Magento 1.4.2 as i dont yet have faith in 1.5.x)
Route 1) Adding Extra image sizes to products
So this route I would somehow add an extra image to my products in the admin area and each product would have a glasses size thumb and a clothing size thumb.
Route 2) Altering the thumbnail size depending on attribute set
I would put some sort of a case statement in the image resizing script to change the size of the thumnail depending on the attribute set the product is using.
If anyone has any other ideas on how this might be accomplished it would be greatly appreciated!
Using different Attribute Set for each of the products (glasses & clothing) is a very good idea for this sort of store. However, you can also try for a separate attribute mentioning the type of product (between glasses & clothing).
Regarding the image resizing, I have found a very easy to use script, whose code is as below:-
public function resizeImage($imageName, $width=NULL, $height=NULL, $imagePath=NULL) {
$imagePath = str_replace("/", DS, $imagePath);
$imagePathFull = Mage::getBaseDir('media') . DS . $imagePath . DS . $imageName;
if ($width == NULL && $height == NULL) {
$width = 100;
$height = 100;
}
$resizePath = $width . 'x' . $height;
$resizePathFull = Mage::getBaseDir('media') . DS . $imagePath . DS . $resizePath . DS . $imageName;
if (file_exists($imagePathFull) && !file_exists($resizePathFull)) {
$imageObj = new Varien_Image($imagePathFull);
$imageObj->constrainOnly(TRUE);
$imageObj->keepAspectRatio(TRUE);
$imageObj->resize($width, $height);
$imageObj->save($resizePathFull);
}
$imagePath = str_replace(DS, "/", $imagePath);
return Mage::getBaseUrl("media") . $imagePath . "/" . $resizePath . "/" . $imageName;
}
You will definitely need to do some tweaking regarding the different dimensions which you want to provide, but still it's a very good piece of code (available here), which has saved my back many-a-times.
Hope it helps.

Drupal - displaying image in theme template from iids value only

I'm trying to theme one of my content types, which has images uploaded to each instance using the image attach module.
Using the developer module, I've found the iids value of the uploaded image (eg 305), but i'm having trouble finding out how I can actually display the image in my code. This line outputs the node id of the image which has been uploaded, but how can I then use that?
$image = $node->iids[0];
I've tried using hook_image, but I can't seem to get that working...
Thanks for any help.
This did the trick...
$nodeid = $node->nid;
$get_image = db_query('
SELECT p.filepath as imagefilename
FROM {image_attach} i
LEFT JOIN {image} a ON i.iid = a.nid
LEFT JOIN {files} p ON a.fid = p.fid
WHERE i.nid = %d AND p.filename = "recipe_thumb"', $nodeid);
$obj_image = db_fetch_object($get_image);
$imagefilename = $obj_image->imagefilename;

Joomla Question: How to have different image in Intro Text and Main Text

Joomla Question: Is there a way to have a different image in intro text? I plan to place a different and smaller image in the introtext.
Could one not duplicate the the opening paragraph/content above the [Read More] line, except with whatever changes are needed? Then, in the article's Advanced Parameters, set the [Intro Text] value to "Hide" so the intro doesn't appear when the article is displayed normally?
look here:
http://www.theartofjoomla.com/home/5-commentary/81-joomlas-hidden-feature-hiding-intro-text.html
I added these code and it works well in my case
<?php
$text = $article->introtext;
if(preg_match('/<\s*img[^>]+>/Ui', $text, $matches)){
$image=$matches[0];
$text = str_replace($image,'',$text);
}
if ($matches) {
$image = str_replace('img src="','img width="100px" src="',$image);
$image = str_replace("caption","", $image);
echo '' . $image . '';
}
else {echo '<img width="100px" src="/images/defaultarticleimage.jpg"
class="defaultArticleImage" />';}
?>
add to the file components/com-contents/view/category/tmpl/default_articles.php (copy this file to your template first)
It's not possible with the current Joomla code.
The intro text is used to display a brief intro the article (usually on the main page) and then once the user opens the article, the intro text is displayed at the top before the rest of the text

Resources