Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Paul_NGC

    (@paul_ngc)

    Hey alchymyth,

    Thanks for the code. But I now use a different code that I’ve found at css-tricks.com

    This is the code that works perfect for me:

    <ul class="submenu">
    			<?php
    				$lastposts = get_posts('numberposts=0&order=ASC&cat=3');
    				foreach($lastposts as $post) :
    				setup_postdata($post); ?>
    
    				<li<?php if ( $post->ID == $wp_query->post->ID )  ?>>
    					<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
    				</li>
    			<?php endforeach; ?>
              </ul>

    But save the snippet because it looks good 🙂

    Thread Starter Paul_NGC

    (@paul_ngc)

    I’ve tried your code, but it breaks the site. Also without the if ( is_home() ) {

    But I’ve found something else that didn’t break the site:

    <ul class="submenu">
         <?php wp_list_pages('title_li=&depth=2&sort_column=menu_order'); ?>
    </ul>

    But this one displays the pages. I need posts based on categories.

    Thread Starter Paul_NGC

    (@paul_ngc)

    At the moment I’m not home, but when I read the codex about The Loop in Action I get the idea I have to wrap every php code in a loop like this?

    <?php if (have_posts()) : ?>
       <?php while (have_posts()) : the_post(); ?>
         <div class="column">
            do something...
         </div>
       <?php endwhile; ?>
    Thread Starter Paul_NGC

    (@paul_ngc)

    Hello Alchymyth

    Thanks for the reply. This is the code. Footer isn’t included because theres nothing in there. The part where it says <?php get_header(); ?> is where index.php starts ( so in this code example you have to ignore it 😉

    http://pastebin.com/duDtaA5Z

    In the header.php part you find 4 times <ul class=”submenu”>
    In there I want to display a list with all posts that have a specific category. Should be simple, but I can’t get it to work…

    Thread Starter Paul_NGC

    (@paul_ngc)

    Nobody has the same problem?

    Thread Starter Paul_NGC

    (@paul_ngc)

    I think you have to open a new thread for your problem. Your question has nothing to do with the problem I have with Mamp.

    Thread Starter Paul_NGC

    (@paul_ngc)

    When I switch to the default theme I just see the main. None of my sidebars show. Not even the standard sidebar is visible :S

    Thread Starter Paul_NGC

    (@paul_ngc)

    Thanks for all the quick replies 🙂
    But also this didn’t work.

    This is how the code of the sidebar looks now in index.php

    <div id="sidebar">
    	<ul>
    	<li id="categories-3" class="widget widget_categories"><h2 class="widgettitle">Categorieën</h2>
    		<ul>
    	<li class="cat-item cat-item-3 current-cat"><a href="http://localhost:8888/wordpress/category/nieuws/" title="Alle berichten opgeslagen onder Nieuws bekijken">Nieuws</a> (5)
    </li>
    	<li class="cat-item cat-item-4"><a href="http://localhost:8888/wordpress/category/vacature/" title="Alle berichten opgeslagen onder Vacature bekijken">Vacature</a> (4)
    <ul class='children'>
    	<li class="cat-item cat-item-14"><a href="http://localhost:8888/wordpress/category/vacature/account/" title="Alle berichten opgeslagen onder Account bekijken">Account</a> (1)
    </li>
    	<li class="cat-item cat-item-13"><a href="http://localhost:8888/wordpress/category/vacature/elektro-vacature/" title="Alle berichten opgeslagen onder Elektro bekijken">Elektro</a> (1)
    </li>
    	<li class="cat-item cat-item-12"><a href="http://localhost:8888/wordpress/category/vacature/gelderland-vacature/" title="Alle berichten opgeslagen onder Gelderland bekijken">Gelderland</a> (2)
    </li>
    </ul>
    </li>
    		</ul>
    </li>
    <li id="execphp-3" class="widget widget_execphp"><h2 class="widgettitle">Test Cat</h2>
    
    			<div class="execphpwidget"></div>
    		</li>
        </ul>
    </div><!-- end sidebar3 -->

    Thread Starter Paul_NGC

    (@paul_ngc)

    I just tried Otto’s Widget. Pasted the php you gave me earlier in the widget, but still no result 🙁

    This is the code from the index.php. Maybe the problem lays in here.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="nl">
    <head profile="http://gmpg.org/xfn/11">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title> &raquo; Nieuws</title>
    <link rel="stylesheet" href="http://localhost:8888/wordpress/wp-content/themes/simpleblocks/style.css" type="text/css" media="screen" />
    <link rel="alternate" type="application/rss+xml" title=" RSS Feed" href="http://localhost:8888/wordpress/feed/" />
    <link rel="pingback" href="http://localhost:8888/wordpress/xmlrpc.php" />
    <meta name='robots' content='noindex,nofollow' />
    <link rel="alternate" type="application/rss+xml" title=" &raquo; Nieuws Categorie Feed" href="http://localhost:8888/wordpress/category/nieuws/feed/" />
    <link rel='stylesheet' id='contact-form-7-css'  href='http://localhost:8888/wordpress/wp-content/plugins/contact-form-7/stylesheet.css?ver=2.0.7' type='text/css' media='all' />
    <script type='text/javascript' src='http://localhost:8888/wordpress/wp-includes/js/jquery/jquery.js?ver=1.3.2'></script>
    <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://localhost:8888/wordpress/xmlrpc.php?rsd" />
    <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://localhost:8888/wordpress/wp-includes/wlwmanifest.xml" />
    <link rel='index' title='' href='http://localhost:8888/wordpress' />
    <meta name="generator" content="WordPress 2.8.5" />
    <script type='text/javascript'>AC_FL_RunContent = 0;</script><script type='text/javascript' src="http://localhost:8888/wordpress/wp-content/plugins/dynamic-headers/AC_RunActiveContent.js"></script>
    </head>
    
    <body>
    
    <div id="page">
    	<div id="header">
        <img src="http://localhost:8888/wordpress/wp-content/header-images/romijnders.jpg" alt="romijnders.jpg" title="romijnders.jpg" />    <div class="title">
    				<h2><a href="http://localhost:8888/wordpress/zinkwerk-van-berkel/" rel="bookmark" title="Permanent Link to Zinkwerk Van Berkel">Zinkwerk Van Berkel</a></h2>
    			</div>
    	</div>
    	<div id="menu">
    			<ul>
    			<li class="page_item page-item-19"><a href="http://localhost:8888/wordpress/organisatie/" title="Organisatie">Organisatie</a></li>
    <li class="page_item page-item-8"><a href="http://localhost:8888/wordpress/oplossingen/" title="Oplossingen">Oplossingen</a></li>
    <li class="page_item page-item-24"><a href="http://localhost:8888/wordpress/service/" title="Service">Service</a></li>
    <li class="page_item page-item-22 current_page_parent"><a href="http://localhost:8888/wordpress/category/nieuws/" title="Nieuws">Nieuws</a></li>
    <li class="page_item page-item-2"><a href="http://localhost:8888/wordpress/contact/" title="Contact">Contact</a></li>
    <li class="page_item page-item-28"><a href="http://localhost:8888/wordpress" title="Home">Home</a></li>
    			</ul>
    	</div><div id="container">
    
    <div id="rightsidebar">
    	<ul>
    	<li id="search-3" class="widget widget_search"><h2 class="widgettitle">Zoek op Romijnders.nl</h2>
    <li id="search">
    	<form id="searchform" action="http://localhost:8888/wordpress" method="get">
    		<input type="text" id="searchinput" name="s" class="searchinput" value="Keywords..." onfocus="if (this.value == 'Keywords...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Keywords...';}" />
    		<input type="submit" id="searchsubmit" value="" />
    	</form>
    </li></li>
    <li id="text-3" class="widget widget_text">			<div class="textwidget"><br />
    <a href="http://localhost:8888/wordpress/contact/" target="_self"><img class="alignnone size-full wp-image-223" title="storing" src="http://localhost:8888/wordpress/wp-content/uploads/2009/12/storing.jpg" alt="storing" width="180" height="55" /></a>
    
    <a href="http://localhost:8888/wordpress/contact/" target="_self"><img class="alignnone size-full wp-image-223" title="storing" src="http://localhost:8888/wordpress/wp-content/uploads/2009/12/groen.jpg" alt="groen" width="180" height="55" /></a>
    
    <a href="http://localhost:8888/wordpress/oplossingen/energiebesparing/" target="_self"><img class="alignnone size-full wp-image-222" title="energie" src="http://localhost:8888/wordpress/wp-content/uploads/2009/12/energie.jpg" alt="energie" width="180" height="55" /></a>
    
    <a href="http://localhost:8888/wordpress/over/login/" target="_self"><img class="alignnone size-full wp-image-221" title="login" src="http://localhost:8888/wordpress/wp-content/uploads/2009/12/login.jpg" alt="login" width="180" height="55" /></a>
    
    <a href="http://localhost:8888/wordpress/organisatie/devils/" target="_self"><img class="alignnone size-full wp-image-224" title="devils" src="http://localhost:8888/wordpress/wp-content/uploads/2009/12/devils.jpg" alt="devils" width="179" height="55" /></a></div>
    		</li>
    	</ul>
    </div><!-- end sidebar2 -->
    
    <div id="sidebar">
    	<ul>
    	<li id="categories-3" class="widget widget_categories"><h2 class="widgettitle">Categorieën</h2>
    		<ul>
    	<li class="cat-item cat-item-3 current-cat"><a href="http://localhost:8888/wordpress/category/nieuws/" title="Alle berichten opgeslagen onder Nieuws bekijken">Nieuws</a> (5)
    </li>
    	<li class="cat-item cat-item-4"><a href="http://localhost:8888/wordpress/category/vacature/" title="Alle berichten opgeslagen onder Vacature bekijken">Vacature</a> (4)
    <ul class='children'>
    	<li class="cat-item cat-item-14"><a href="http://localhost:8888/wordpress/category/vacature/account/" title="Alle berichten opgeslagen onder Account bekijken">Account</a> (1)
    </li>
    	<li class="cat-item cat-item-13"><a href="http://localhost:8888/wordpress/category/vacature/elektro-vacature/" title="Alle berichten opgeslagen onder Elektro bekijken">Elektro</a> (1)
    </li>
    	<li class="cat-item cat-item-12"><a href="http://localhost:8888/wordpress/category/vacature/gelderland-vacature/" title="Alle berichten opgeslagen onder Gelderland bekijken">Gelderland</a> (2)
    </li>
    </ul>
    </li>
    		</ul>
    </li>
    <li id="execphp-3" class="widget widget_execphp"><h2 class="widgettitle">Test Cat</h2>
    
    			<div class="execphpwidget"></div>
    		</li>
        </ul>
    </div><!-- end sidebar3 -->
    
    <div id="main">
    				<div class="post" id="post-212">
    
                <div class="title2">
    				<h1><a href="http://localhost:8888/wordpress/zinkwerk-van-berkel/" rel="bookmark" title="Permanent Link to Zinkwerk Van Berkel">Zinkwerk Van Berkel</a></h1>
    				<div class="postmeta">
    					<span class="postmeta_category"><a href="http://localhost:8888/wordpress/category/nieuws/" title="Ale berichten bekijken in Nieuws" rel="category tag">Nieuws</a></span>
    				</div><!-- end postmeta -->
    			</div><!-- end title2 -->
    
    			<div class="entry">
    				<p>Gemeentemuseum Arnhem<br />
    Toen het Nijmeegse bedrijf Van Berkel nog niet bij de Romijnders Groep hoorde, was directeur Frans van Berkel zelf verantwoordelijk voor het dakwerk. Na zijn afscheid was er niemand binnen het bedrijf die gespecialiseerd was in het dakwerk. Peereboom: “ Dat is toen bij mij op het bordje terechtgekomen.” Alle aanvragen binnen onze regio komen bij Van Berkel terecht. Bij het museumproject in Arnhem zijn Bas Janssen en Theo Megens de twee monteurs die het zink hebben aangebracht. <a href="http://localhost:8888/wordpress/zinkwerk-van-berkel/#more-212" class="more-link">Lees verder >></a></p>
    			</div><!-- end entry -->
    
    			<div class="additionalinfo">
    							</div><!-- end additional info -->
    
    		</div><!-- end post -->
    				<div class="post" id="post-209">
    
                <div class="title2">
    				<h1><a href="http://localhost:8888/wordpress/retail-pakket-romijnders/" rel="bookmark" title="Permanent Link to Retail Pakket Romijnders">Retail Pakket Romijnders</a></h1>
    				<div class="postmeta">
    					<span class="postmeta_category"><a href="http://localhost:8888/wordpress/category/nieuws/" title="Ale berichten bekijken in Nieuws" rel="category tag">Nieuws</a></span>
    				</div><!-- end postmeta -->
    			</div><!-- end title2 -->
    
    			<div class="entry">
    				<p>Electra, airco, sanitair, CV, zwakstroom-installatie:<br />
    De retail-unit van Romijnders biedt winkeliers alle ‘gebouwgebonden installaties’ onder één noemer.</p>
    <p>Vanaf mei 2007 biedt Romijnders Horssen een compleet pakket aan voor de detailhandel. Samen met de andere vestigingen van Romijnders verzorgt Horssen de gehele W&E installatie bij (her) inrichting van winkels. Marcel Willems, vestigingsleider van Horssen en Henk Veens, projectleider voor de DA drogisterijen over de nieuwe aanpak. <a href="http://localhost:8888/wordpress/retail-pakket-romijnders/#more-209" class="more-link">Lees verder >></a></p>
    			</div><!-- end entry -->
    
    			<div class="additionalinfo">
    							</div><!-- end additional info -->
    
    		</div><!-- end post -->
    				<div class="post" id="post-206">
    		</div><!-- end post -->
    
        	<div class="navi">
    			<div class="left"></div>
    			<div class="right"></div>
    		</div><!-- end navi -->
    
    			</div><!-- end main -->
    
    </div><!-- end container -->
    <div id="footer">
    	<div class="footer_left">
    		<h3>Romijnders &middot; 2009 - 2010 </h3>
    	</div>
    	<div class="footer_right">
    		<h3>[email protected] </h3>
    	</div>
    </div><!-- end footer -->
    <script type='text/javascript' src='http://localhost:8888/wordpress/wp-includes/js/jquery/jquery.form.js?ver=2.02m'></script>
    <script type='text/javascript' src='http://localhost:8888/wordpress/wp-content/plugins/contact-form-7/contact-form-7.js?ver=2.0.7'></script>
    </div><!-- end page -->
    </body>
    </html>
    Thread Starter Paul_NGC

    (@paul_ngc)

    Thanks for the reply. I added the code to sidebar.php, but nothing happens unfortunately.

    This is the code of my sidebar.php:

    <div id="sidebar">
    	<ul>
    	<?php
    global $posts;
    echo get_post_meta($posts[0]->ID, 'sidebar', TRUE);
    ?>
    	</ul>
    
            <ul>
    		<?php wp_register(); ?>
    		<li><?php wp_loginout(); ?></li>
    		</ul>
    		</li>
    		<?php endif; ?>
    	</ul><!-- end ul -->
        </div><!-- end sidebar -->

    In the sidebar is also a Category Widget from WordPress.

Viewing 10 replies - 1 through 10 (of 10 total)