• Hi. I like the main slider on the main page but would also like it to show when user’s click a navigation menu item that shows a certain category of posts. Is there a way to make that one category show a slider of recent things as well?

Viewing 1 replies (of 1 total)
  • Sorry Water is Great, I don’t have the answer but I have just about the same question:

    -In the category I added extra fields “afbeelding1, afbeelding2 etc”

    (part of) my header.php
    <body>
    <div id=”slider”>
    <?php $image = wp_get_attachment_image_src(get_field(‘afbeelding_1’), ‘full’); ?>
    <?php if (!empty($image)) { ;?>
    <img src=”<?php echo $image[0]; ?>” alt=”vakantie, valle-brembana, italiadesso, Noord-Italie, appartementen, hotels, bed-and-breakfast, agriturismo” />
    <?php }; ?>
    <?php $image = wp_get_attachment_image_src(get_field(‘afbeelding_2’), ‘full’); ?>
    <?php if (!empty($image)) { ;?>
    <img src=”<?php echo $image[0]; ?>” alt=”vakantie, Noord-Italie, valle-brembana, italiadesso, MTB, wandelen, fietsen, wintersport, klimmen” />
    <?php }; ?>
    <?php $image = wp_get_attachment_image_src(get_field(‘afbeelding_3’), ‘full’); ?>
    <?php if (!empty($image)) { ;?>
    <img src=”<?php echo $image[0]; ?>” alt=”Noord-Italie, vakantie, valle-brembana, italiadesso, live-with-the-locals, authentiek, appartementen, hotels, bed-and-breakfast, agriturismo” />
    <?php }; ?>
    <?php $image = wp_get_attachment_image_src(get_field(‘afbeelding_4’), ‘full’); ?>
    <?php if (!empty($image)) { ;?>
    <img src=”<?php echo $image[0]; ?>” alt=”vakantie, Orobische-Alpen, Alpen, actieve-vakantie, valle-brembana, italiadesso, appartementen, hotels, bed-and-breakfast, agriturismo” />
    <?php }; ?>
    <?php $image = wp_get_attachment_image_src(get_field(‘afbeelding_5’), ‘full’); ?>
    <?php if (!empty($image)) { ;?>
    <img src=”<?php echo $image[0]; ?>” alt=”vakantie, valle-brembana, italiadesso, Bergamo, San-Pellegrino, appartementen, hotels, bed-and-breakfast, agriturismo” />
    <?php }; ?>

    <?php if(is_404() ) { ?>
    <img src=”https://www.italiadesso.nl/wp-content/uploads/2013/06/ItaliAdesso-sorry.jpg&#8221; alt=”ItaliAdesso, Noord italie, vakantie” />
    <?php } ?>
    </div>

    My category.php is

    <?php get_header(); ?>
    <div id=”content” class=”content”>
    <?php if(is_front_page() ) { ?>
    <?php } else { ?>
    <?php if ( function_exists(‘yoast_breadcrumb’) ) { yoast_breadcrumb(‘<p id=”breadcrumbs”>’,'</p>’); } ?>
    <?php } ?>
    <div id=”articleHolder”>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <?php echo do_shortcode(‘[pt_view id=”ff838fdb85″]’); ?>
    <?php endwhile; else: ?>
    </div>
    <?php endif; ?>
    </div>
    <?php get_sidebar(); ?>
    </div>
    <?php get_footer(); ?>

    I don’t understand why it doesn’t work

Viewing 1 replies (of 1 total)
  • The topic ‘Show slider on category?’ is closed to new replies.