Hi,
I’d like to have the slider from front page also apear on my blog / content / post pages. How to do that ?
I know php very well.
Hi,
I’d like to have the slider from front page also apear on my blog / content / post pages. How to do that ?
I know php very well.
Hey,
If you just want to copy the slider code to other pages (so you want to use the same slider with the same images) on other pages you need to copy following code into your page template:
<div id="featured">
<div id="featured_image"><?php
######################################################################
# Get Images for the Basic Image Slider
######################################################################
// these are the images for the jQuery slideshow, rendered with the help of the class
// framework/theme_plugins/kriesi_menu_manager/kriesi_slider_display
if(is_object($k_option['custom']['slider'])) $k_option['custom']['slider']->display('Mainpage Slider'); ?>
</div><!--end featured_image-->
</div><!--end featured-->
If you want to use other images you must do some major modifications we can't help you with.
I want to displaye the exact same slider on other pages.
I pased the code, but i don't have the background (gray color) behinf the slider. Take a look here: http://www.vjeranpas.com/?p=14
Hey,
just delete following code from style1.css:
#subpage .wrapper{
background: #fff url(../images/skin1/bg.png) repeat-x 0 -370px;
}Hi,
I also want to appear the slider from mainpage at other pages and posts. I've copied the above code from Dude into my page.php but the slider seems to appear blank. No images will appear.
The beginning of page.php looks now like this
<?php
global $k_options;
if ($post->ID == $k_options['contact']['contact_page']) $contactpage = true;
if ($post->ID == $k_options['portfolio']['folio_page']) $portfoliopage = true;
if ($post->ID == $k_options['blog']['blog_page']) $blogpage = true;
if($contactpage)
{
include(TEMPLATEPATH."/template_contact.php");
}
else if($blogpage)
{
include(TEMPLATEPATH."/template_blog.php");
}
else if($portfoliopage)
{
include(TEMPLATEPATH."/template_portfolio.php");
}else{
get_header(); ?>
<div id="featured">
<div id="featured_image"><?php
######################################################################
# Get Images for the Basic Image Slider
######################################################################
// these are the images for the jQuery slideshow, rendered with the help of the class
// framework/theme_plugins/kriesi_menu_manager/kriesi_slider_display
if(is_object($k_option['custom']['slider'])) $k_option['custom']['slider']->display('Mainpage Slider');
$firstitem = "current";
?>
</div><!--end featured_image-->
</div><!--end featured-->
<div id="main">
<div id="content" class="bg_sidebar">
<div id="inner_content">
What can I do?
btw: I am using twicet. Dont know if it is the right thread.
I used the wrong theme all the time (Cubit) - (I don't know why I thought that's your theme :( ). For twicet the slider code can be found in index.php. Search for:
<div id="featured">
<?php
# Here starts the code for the Mainpage Image Slider
if($k_options['mainpage']['frontpage_image_count']){$mycount = $k_options['mainpage']['frontpage_image_count']; }else{$mycount = 5;}
$query_string .= "&showposts=$mycount";
$query_string .= "&cat=".$k_options['mainpage']['slider_cat_final'];
query_posts($query_string);
$firstitem = "current";
if (have_posts()) :
while (have_posts()) : the_post();
$frontpage_image = get_post_meta($post->ID, "frontpage-image", true);
$frontpage_image_small = get_post_meta($post->ID, "frontpage-image-small", true);
$frontpage_blank = get_post_meta($post->ID, "frontpage-blank", true);
$punchline = get_post_meta($post->ID, "punchline", true);
$link = get_permalink();
if($frontpage_image != "" && $k_options['general']['tim'] == 1)
{
$resizepath = get_bloginfo('template_url')."/timthumb.php?src="; #timthumb path
$resize_options1 = "&w=44&h=30&zc=1";
$frontpage_image_small = $resizepath.$frontpage_image.$resize_options1;
}
$previewpics[$link] = $frontpage_image_small;
echo'<div class="featured_item '.$firstitem.'">'."\n";
$firstitem = "";
if(!$frontpage_blank) #user did not set the option "no text"
{
echo'<div class="featured_text">'."\n";
echo'<div class="entry">'."\n";
echo'<span class="meta">'.$punchline.'</span>'."\n";
echo'<h2><a href="'.$link.'" title="'.get_the_title().'" >'.get_the_title().'</a></h2>'."\n";
the_excerpt();
echo'</div>'."\n";
echo'<a href="'.get_permalink().'" class="read-more">Read more</a><a href="#" class="show-next">Next »</a>'."\n";
echo'</div><!-- end featured_text-->'."\n";
}
echo'<div class="featured_image"><!--an image only slide -->'."\n";
echo'<a href="'.get_permalink().'"><img src="'.$frontpage_image.'" alt="" /></a>'."\n";
echo'</div><!-- end featured_item-->'."\n";
echo'</div><!-- end featured_image-->'."\n";
endwhile;
endif;
# Here starts the code for the newsticker
if($k_options['mainpage']['frontpage_ticker_count'] != ""){$ticker_count = $k_options['mainpage']['frontpage_ticker_count']; }else{$ticker_count = 5;}
$query_string = "&showposts=$ticker_count";
$query_string .= "&cat=".$k_options['mainpage']['ticker_cat_final'];
query_posts($query_string);
echo'<div id="featured_bottom">'."\n";
if($k_options['mainpage']['ticker_autorotate']==1)
{
echo'<div class="ticker">'."\n";
$firstitem = "class='active_ticker'"."\n";
if (have_posts()) :
while (have_posts()) : the_post();
echo'<span '.$firstitem.' ><a href="'.get_permalink().'"><strong>Latest News:</strong> '.get_the_title().'</a></span>'."\n";
$firstitem = "";
endwhile;
endif;
echo'</div><!--end ticker-->'."\n";
}
#start of small Preview images
$firstitem = "class='current_prev'";
echo '<div class="preview_images">'."\n";
foreach($previewpics as $link => $pic)
{
echo '<a '.$firstitem.' href="'.$link.'"><img src="'.$pic.'" alt="" height="30px" width="44px" /></a>'."\n";
$firstitem = "";
}
echo '</div><!-- end preview_images-->'."\n";
echo '</div><!-- end featured_bottom-->'."\n";
echo '</div><!-- end featured-->'."\n";
?>
I cleaned up the thread a bit...
Okay, thank you again. :-) That points to my question: How can I show the slider from the mainpage on other pages and posts? Copying the above code dont works.
I did some testing and the slider appears on posts/pages but the query messes things up (only the first post appears in the slider and others are displayed in blog style...). I think the major problem is that query_post() function conflicts with the "main query". I modified the query code so it doesn't conflict with the main query. In single.php replace (should also work in page.php):
<?php get_header(); ?>
with:
<?php get_header(); ?>
<div id="featured">
<?php
# Here starts the code for the Mainpage Image Slider
if($k_options['mainpage']['frontpage_image_count']){$mycount = $k_options['mainpage']['frontpage_image_count']; }else{$mycount = 5;}
$query_string_custom = "showposts=$mycount";
$query_string_custom .= "&cat=".$k_options['mainpage']['slider_cat_final'];
query_posts($query_string_custom);
$firstitem = "current";
if (have_posts()) :
while (have_posts()) : the_post();
$frontpage_image = get_post_meta($post->ID, "frontpage-image", true);
$frontpage_image_small = get_post_meta($post->ID, "frontpage-image-small", true);
$frontpage_blank = get_post_meta($post->ID, "frontpage-blank", true);
$punchline = get_post_meta($post->ID, "punchline", true);
$link = get_permalink();
if($frontpage_image != "" && $k_options['general']['tim'] == 1)
{
$resizepath = get_bloginfo('template_url')."/timthumb.php?src="; #timthumb path
$resize_options1 = "&w=44&h=30&zc=1";
$frontpage_image_small = $resizepath.$frontpage_image.$resize_options1;
}
$previewpics[$link] = $frontpage_image_small;
echo'<div class="featured_item '.$firstitem.'">'."\n";
$firstitem = "";
if(!$frontpage_blank) #user did not set the option "no text"
{
echo'<div class="featured_text">'."\n";
echo'<div class="entry">'."\n";
echo'<span class="meta">'.$punchline.'</span>'."\n";
echo'<h2><a href="'.$link.'" title="'.get_the_title().'" >'.get_the_title().'</a></h2>'."\n";
the_excerpt();
echo'</div>'."\n";
echo'<a href="'.get_permalink().'" class="read-more">Read more</a><a href="#" class="show-next">Next »</a>'."\n";
echo'</div><!-- end featured_text-->'."\n";
}
echo'<div class="featured_image"><!--an image only slide -->'."\n";
echo'<a href="'.get_permalink().'"><img src="'.$frontpage_image.'" alt="" /></a>'."\n";
echo'</div><!-- end featured_item-->'."\n";
echo'</div><!-- end featured_image-->'."\n";
endwhile;
endif;
# Here starts the code for the newsticker
if($k_options['mainpage']['frontpage_ticker_count'] != ""){$ticker_count = $k_options['mainpage']['frontpage_ticker_count']; }else{$ticker_count = 5;}
$query_string_custom = "&showposts=$ticker_count";
$query_string_custom .= "&cat=".$k_options['mainpage']['ticker_cat_final'];
query_posts($query_string_custom);
echo'<div id="featured_bottom">'."\n";
if($k_options['mainpage']['ticker_autorotate']==1)
{
echo'<div class="ticker">'."\n";
$firstitem = "class='active_ticker'"."\n";
if (have_posts()) :
while (have_posts()) : the_post();
echo'<span '.$firstitem.' ><a href="'.get_permalink().'"><strong>Latest News:</strong> '.get_the_title().'</a></span>'."\n";
$firstitem = "";
endwhile;
endif;
echo'</div><!--end ticker-->'."\n";
}
#start of small Preview images
$firstitem = "class='current_prev'";
echo '<div class="preview_images">'."\n";
foreach($previewpics as $link => $pic)
{
echo '<a '.$firstitem.' href="'.$link.'"><img src="'.$pic.'" alt="" height="30px" width="44px" /></a>'."\n";
$firstitem = "";
}
echo '</div><!-- end preview_images-->'."\n";
echo '</div><!-- end featured_bottom-->'."\n";
echo '</div><!-- end featured-->'."\n";
wp_reset_query();
?>Wonderful. Many thanks for your help. Changed the code a little bit for my purposes. But now it is nearly perfect. Wanna have a look?
http://www.hochzeitsauto-leipzig.de/
Thank you again and sorry for annoying you. :)
No problem - really nice design btw :)
and please excuse my theme confusion....
Thank you.
Hey team, I was reading the board and am interested in this post. I'd like to add the slideshow feature to each category called up on my page http://www.stubstory.com so that if people select the "NCAA Basketball" pop-down - the resulting page with produce the posts in that category with the slider at the top featuring ONLY NCAA Basketball posts.
In his initial reply, Dude states "If you want to use other images you must do some major modifications we can't help you with." Here's my problem, Who can help me. I'm an entrepreneur and appear woefully unqualified to find someone I can trust with my blog - particularly at this level. Parcells said "If you want me to cook the dinner, let me buy the groceries". You guys cooked the dinner - in this cast the Newscast theme - please tell me who can do this customization for me. I'll pay for the work but don't want some dope telling me he can do what you guys can are intimately familiar with. This feature will be a key point in what I am trying to do with my site and you are the keepers of the knowledge. Play some forward - let me hire someone on your team, or give me a name or two of people you CAN trust. Cause I trust you. Thanks - Matt
Hey,
I'm interested - send me a mail to: kriesi2000-dude@yahoo.com and I'll make a quote. I take an exam on Monday so maybe it will take some days until I can look into it.
You must log in to post.