I want to display the title in the NextGen gallery. The plugin does not offer an option for that, so I have to somehow go past it, and modify the code.
NextGen Version:2.0.33.
Has anyone got across the same problem? How can I solve it?
Stefan - The view folder is in the modules/ngglegacy folder. New version I guess.
As for the gallery title, I modified some code I found here,
http://psychopixi.com/tech/how-to-link-back-to-an-album-in-a-nextgen-gallery/
It's actually for showing breadcrumbs and providing a back button, but if you change the values of the iterators myi and myi2 in lines 10 and 13 it will just output with the title, which you can format as you wish.
As per their suggestion I used the plugin Shortcode Exec PHP to make shortcode which I then placed in my gallery page. You can then place the shortcode for your gallery after.
It's not an elegant solution, and it assumes that the url of your gallery has the name of the gallery in it.
Good luck.
<?php echo $gallery->title ?>
Place this in your gallery template file wherever it's needed.
I found a solution to this problem having searched all day on inet.
Your 'view' folder is in the ngglegacy folder of the plugin. You can add <?php echo $gallery->title ?> to that file. Then goto Gallery options in your admin area and select gallery.php to show for the Basic Thumbnails.
thats it!
Related
I couldn't find a tutorial or hint regarding making a product image in the wordpress theme "uncode" clickable. when clicking on the product image, it only opens the image in full size but doesnt rather redirect to the details page.
I assume it isn't a big thing that needs to be changed/added, but finding it seems quite difficult, as I have no experience regarding this theme at all.
thanks upfront!
EDIT: What I am trying to find out, is how to make this (tutorial for another theme https://slocumthemes.com/2015/10/how-to-make-woocommerce-thumbnails-clickable/) for my theme, uncode.
can anybody help? I think I found the line of code in one of the php files, but I have no proper experience of php
You can override woocommerce template.
Create a folder named woocommerce in your uncode theme and further corresponding folders where relevant file is added in woocommmerce plugin. e.g woocommerce/templates/single-product/product-image.php.
In that overridden file you can customize the HTML i.e link your image.
How do you insert an image from the server folder to the wordpress post with a shortcode, (i don't wanna insert image manually) ?
I've search from google, and see the plugin that approached my desire:
wordpress.org/plugins/folder-gallery/
an example of using this plugin's shortcode is:
[foldergallery folder = "wp-content/uploads/cars"]
(the plugin search for folder cars, and show the image content)
it's good, the plugin will show gallery with lots of thumbnails,
example result:
but this is not what i want.
I want the result is all image in a folder will show up with full size in the post.
is somebody here know another plugin or another way to make it happen, or maybe to create own shortcode to show full image size?
thanks,
Gerga
Just add the HTML anywhere in the post (preferably in he HTML mode of the Editor)
<img src="/wp-content/folder/car.jpg" style="width: 100%,">
as the title might let you suggest I have trouble to get image URL's out of product descriptions in my custom phtml file (located in template folder).
In cms pages/blocks you can use
{{media url="wysywig/Banner/image.jpg"}}
which we do for parts (headlines) of our product descriptions.
Now when I try to display that description out of my phtml file with
<?php echo nl2br($productResult[$i]->getDescription()); ?>
the description gets loaded but the image URL's dont get converted to total
URL's like for example "/media/wysywig/banner".
I know that you have to use Mage::getUrl("media") in php/phtml files though this information doesn't help much in my situation.
The only idea I have is to set a string function to search for
{{media url="wysywig/banner/image.jpg"}}
and replace it with
Mage::getUrl("media/wysywig/image.jpg")
but I kinda feel like this isn't a very elegant solution.
Or is it the only way? Any help is appreciated.
Much thanks and greetings mpfmon
It doesn't work because it was not planned for the product description to have such media call:
{{media url="wysywig/Banner/image.jpg"}}
However there is nothing wrong doing this, to make it work, you have to filter your description with a widget function:
echo Mage::getSingleton('widget/template_filter')->filter($description);
You must enable "Allow Dynamic Media URLs in Products and Categories" setting in Catalog section of Magento configuration screen. (See attached image)
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!
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.