JeroenOnstenk
Member
Posted 4 years ago #
I would like to show a Next Gen album outside the content and the sidebar. I made a sort of block between the content and the footer, and i would like to show a Next Gen album there.
I tried with adding this code [album=1,compact] inside this block, but that didn't worked. It only shows that specific text.
Which code do I need to use to show Next Gen album?
http://test.jeroenonstenk.nl/activiteiten/
WhisperT
Member
Posted 4 years ago #
I used this:
<?php echo nggShowAlbum($albumID,$mode); ?>
Replacing $albumID with the id of the album you want to use, and replacing $mode with the mode you want to use (or leave it blank if you wish to use the default mode)
The functions which replace the shortcode are found in nggfunctions.php
Anyone feel free to correct me if there is a better way to do this. I'm using this though and it works for me.
JeroenOnstenk
Member
Posted 4 years ago #
@ WhisperT
Unfortunately that code doesn't seem to work here. I tried different variations on the code but it didn't showed the album.
I tried the following:
<?php echo nggShowAlbum(1,compact); ?>
<?php echo nggShowAlbum($albumID = "1",$mode = "compact"); ?>
<?php echo nggShowAlbum($albumID = 1,$mode = "compact"); ?>
But none worked.
In the source code a small part is called though, but only this part:
<div class="ngg-albumoverview"></div>
<div class="ngg-clear"></div>
The mode and the albumID aren't shown
WhisperT
Member
Posted 4 years ago #
<?php $footeralbum = '[album=1]';
$footeralbum = apply_filters('the_content', $footeralbum );
echo $footeralbum; ?>
OK here try this instead. The other works for me but I have my template tweaked out pretty bad. I know this one works too.
The code for albums is now a little bit more complicate, I will introduce a better template function in the next version
JeroenOnstenk
Member
Posted 4 years ago #
Thanks WhisperT, that code worked.
I changed it a little to have it working with the compact style, instead of the extend style
<?php $footeralbum = '[album=1,compact]';
$footeralbum = apply_filters('the_content', $footeralbum );
echo $footeralbum; ?>
But also a big thanks @ Alex!
A better template function would be more then welcome.
JeroenOnstenk
Member
Posted 4 years ago #
@ Alex
What could be great is that the album mode (the album overview) is shown outside the content and the album page inside the content.
Now I have album page in the same spot as the overview, and I wish it would appear in the content area.
http://test.jeroenonstenk.nl/
JeroenOnstenk
Member
Posted 4 years ago #
Or is this already possible and am I overlooking something...?
firehead
Member
Posted 3 years ago #
is there a way to do this with galleries?
if so ... here's the kicker ... is there a way to randomize it?
- sean