Ondersteuning » Code oplossingen gezocht » "Latest projects" uit code slopen?

  • Opgelost hannevelde

    (@hannevelde)


    Voor een kennis ben ik een wordpress site aan het inrichten voor de verhuur van haar appartementen. Ik gebruik hiervoor het AIRwp theme van themeforest. Heel mooi allemaal, maar op de home page wordt onderaan de pagina automatisch driedubbel verwezen naar “Latest projects”. Ik heb die functie niet nodig en wil het stukje code dat hier voor zorgt graag verwijderen. Ik heb me helemaal suf gezocht, maar ik heb het nog niet kunnen vinden. Iemand met meer code-inzicht die me kan helpen? Volgens mij moet het in dit bestand staan, home.php:

    <?php
    /**
     * @package WordPress
     * @subpackage AirWP
     */
    
    get_header(); 
    
    $tags = array("img");
    $root = get_template_directory_uri();
    
    $air_slider_style = get_option("air_slider_style");
    
    if ($air_slider_style != "no_slider")
    {
    $air_slider_page = get_option("air_slider_page");
    if ($air_slider_page != "")
    {
    $my_query = new WP_Query("page_id=$air_slider_page");
    while ($my_query->have_posts()) : $my_query->the_post();
    
    $content = get_the_content_with_formatting();
    $images = get_all_img_urls($content);
    
    $only_text = strip_single_tags($tags, $content);
    
    ?>
    <div class="slideshow">
    <?php
    if ($air_slider_style == "text_slide") { ?>
    	<div class="slide-text">
        <?php echo $only_text; ?>
    	</div><!--END of slide-text-->
    <?php
    $style = "style1";
    $w = 640;
    }
    if ($air_slider_style == "only_slide")
    {
    $style = "style2";
    $w = 960;
    }
    ?>
    	<div class="nivoSlider <?php echo $style; ?>" id="slidernivo">
        <?php
    	foreach ($images as $image)
    	{
    		$resized = vt_resize( '', $image , $w, 350, true );
    	?>
    		<img src="<?php echo $resized[url]; ?>" alt="" width="<?php echo $w; ?>" height="350"/>
        <?php
    	}
    	?>
    
    	</div><!--END slidernivo-->
    
    </div><!--END slideshow-->
    <?php endwhile;
    }
    
    }
    
    ?>
    <div id="content">
    <?php
    $air_home_grid = get_option("air_home_grid");
    if ($air_home_grid == "yes")
    {
    	$air_grid_title = get_option("air_grid_title");
    	$air_grid_link_text = get_option("air_grid_link_text");
    	$air_grid_link_url = get_option("air_grid_link_url");
    	$air_grid_category = get_option("air_grid_category");
    	$air_grid_rows = get_option("air_grid_rows");
    	$no = 4 * $air_grid_rows;
    ?>
    	<div id="portfolio-home">
    	<div class="overline"><h2><?php echo get_option("air_grid_title"); ?> / <a href="<?php echo get_option("air_grid_link_url"); ?>"><?php echo get_option("air_grid_link_text"); ?></a></h2></div>
    		<div class="grid">
    
    			<ul>
    <?php
    	$my_query = new WP_Query("cat=$air_grid_category&posts_per_page=$no");
    	while ($my_query->have_posts()) : $my_query->the_post();
    	$content = get_the_content_with_formatting();
    	$images = get_all_img_urls($content);
    	$resized = vt_resize( '', $images[0] , 240, 240, true );
    		if(!empty($post->post_excerpt)) {
                 //This post have an excerpt, let's display it
                 $excerpt = get_the_excerpt();
             } else {
                 // This post have no excerpt
    			$excerpt = better_excerpt($content, 24);
             }
    ?>
    				<li>
    				  <div class="portfolio-item">
    						<div class="portfolio-thumbnail">
    							<h3 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
    							<p><?php echo $excerpt; ?></p>
    							<a href="<?php the_permalink(); ?>" class="read-more">view details &raquo;</a>
    						</div><!--END portfolio-thumbnail-->
    					<img src="<?php echo $resized[url]; ?>" width="240" height="240" alt="" />
    					</div><!--END portfolio-item-->
    				</li>
    <?php
    	endwhile;
    ?>
    
                </ul><!--END portfolio-tiles-gallery-->
    
    		</div><!--END portfolio-wrap-->
    
    	</div><!--END portfolio ID-->
    <?php
    
    }
    ?>
    
    <?php
    $air_row_1 = get_option("air_row_1");
    if ($air_row_1 != "Nothing")
    {
    ?>
    	<div class="overline"><h2><?php echo get_option("air_row_1_title"); ?> / <a href="<?php echo get_option("air_row_1_link_url"); ?>"><?php echo get_option("air_row_1_link_text"); ?></a></h2></div>
    
    <?php
    if ($air_row_1 == "Category articles" || $air_row_1 == "Portfolio articles")
    {
    	$i = 0;
    	$air_row_1_category = get_option("air_row_1_category");
    	$my_query = new WP_Query("cat=$air_row_1_category&posts_per_page=3");
    	while ($my_query->have_posts()) : $my_query->the_post();
    	$i++;
    	$content = get_the_content_with_formatting();
    	$images = get_all_img_urls($content);
    	$resized = vt_resize( '', $images[0] , 300, 180, true );
    	if(!empty($post->post_excerpt)) {
                 //This post have an excerpt, let's display it
                 $excerpt = get_the_excerpt();
             } else {
                 // This post have no excerpt
    			$excerpt = better_excerpt($content, 24);
             }
    	?>
    	<div class="one-third home-entry <?php if ($i == 3) echo " last"?>">
        <?php if ($air_row_1 == "Portfolio articles") { ?>
    
    		<img src="<?php echo $resized[url]; ?>" width="300" height="180" class="shadow" alt="" />
    		<h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
        	<?php }
    		if ($air_row_1 == "Category articles") {
    		?>
            <div class="post-meta">
    			<?php the_time('F jS, Y') ?> <?php if (comments_open()) { echo " - "; comments_popup_link('No Comments', '1 Comment', '% Comments'); } ?>
    		</div><!--END meta-->
    		<h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    		<p><?php echo $excerpt; ?></p>
    
            <?php } ?>
    	</div><!--END one-third-->
        <?php
    	endwhile;
    }
    
    if ($air_row_1 == "Pages")
    {
    	$air_row_1_page_1 = get_option("air_row_1_page_1");
    	$my_query = new WP_Query("page_id=$air_row_1_page_1");
    	while ($my_query->have_posts()) : $my_query->the_post();
    	$content = get_the_content_with_formatting();
    	$images = get_all_img_urls($content);
    	$resized = vt_resize( '', $images[0] , 300, 180, true );
    	if(!empty($post->post_excerpt)) {
                 //This post have an excerpt, let's display it
                 $excerpt = get_the_excerpt();
             } else {
                 // This post have no excerpt
                $excerpt = better_excerpt($content, 24);
             }
    	?>
        <div class="one-third home-entry">
        <?php if ($images) { ?>
    		<img src="<?php echo $resized[url]; ?>" width="300" height="180" class="shadow" alt="" />
        <?php } ?>
    		<h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    		<p><?php echo $excerpt; ?></p>
    	</div><!--END one-third-->
    
        <?php
    	endwhile;
    
    	$air_row_1_page_2 = get_option("air_row_1_page_2");
    	$my_query = new WP_Query("page_id=$air_row_1_page_2");
    	while ($my_query->have_posts()) : $my_query->the_post();
    	$content = get_the_content_with_formatting();
    	$images = get_all_img_urls($content);
    	$resized = vt_resize( '', $images[0] , 300, 180, true );
    	if(!empty($post->post_excerpt)) {
                 //This post have an excerpt, let's display it
                 $excerpt = get_the_excerpt();
             } else {
                 // This post have no excerpt
                $excerpt = better_excerpt($content, 24);
             }
    	?>
        <div class="one-third home-entry">
    	<?php if ($images) { ?>
    		<img src="<?php echo $resized[url]; ?>" width="300" height="180" class="shadow" alt="" />
        <?php } ?>
    		<h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    		<p><?php echo $excerpt; ?></p>
    	</div><!--END one-third-->
        <?php
    	endwhile;
    
    	$air_row_1_page_3 = get_option("air_row_1_page_3");
    	$my_query = new WP_Query("page_id=$air_row_1_page_3");
    	while ($my_query->have_posts()) : $my_query->the_post();
    	$content = get_the_content_with_formatting();
    	$images = get_all_img_urls($content);
    	$resized = vt_resize( '', $images[0] , 300, 180, true );
    	if(!empty($post->post_excerpt)) {
                 //This post have an excerpt, let's display it
                 $excerpt = get_the_excerpt();
             } else {
                 // This post have no excerpt
                $excerpt = better_excerpt($content, 24);
             }
    	?>
        <div class="one-third home-entry last">
    	<?php if ($images) { ?>
    		<img src="<?php echo $resized[url]; ?>" width="300" height="180" class="shadow" alt="" />
        <?php } ?>
    		<h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    		<p><?php echo $excerpt; ?></p>
    	</div><!--END one-third-->
        <?php
    	endwhile;
    }
    ?><div class="divider"></div><?php
    }
    ?>
    
    <?php
    $air_row_2 = get_option("air_row_2");
    if ($air_row_2 != "Nothing")
    {
    ?>
    
    <?php
    if ($air_row_2 == "Category articles" || $air_row_2 == "Portfolio articles")
    {
    	$i = 0;
    	$air_row_2_category = get_option("air_row_2_category");
    	$my_query = new WP_Query("cat=$air_row_2_category&posts_per_page=3");
    	while ($my_query->have_posts()) : $my_query->the_post();
    	$i++;
    	$content = get_the_content_with_formatting();
    	$images = get_all_img_urls($content);
    	$resized = vt_resize( '', $images[0] , 300, 180, true );
    	if(!empty($post->post_excerpt)) {
                 //This post have an excerpt, let's display it
                 $excerpt = get_the_excerpt();
             } else {
                 // This post have no excerpt
    			$excerpt = better_excerpt($content, 24);
             }
    	?>
    	<div class="one-third home-entry <?php if ($i == 3) echo " last"?>">
        <?php if ($air_row_2 == "Portfolio articles") { ?>
    
    		<img src="<?php echo $resized[url]; ?>" width="300" height="180" class="shadow" alt="" />
    		<h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
        	<?php }
    		if ($air_row_2 == "Category articles") {
    		?>
            <div class="post-meta">
    			<?php the_time('F jS, Y') ?> <?php if (comments_open()) { echo " - "; comments_popup_link('No Comments', '1 Comment', '% Comments'); } ?>
    		</div><!--END meta-->
    		<h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    		<p><?php echo $excerpt; ?></p>
    
            <?php } ?>
    	</div><!--END one-third-->
        <?php
    	endwhile;
    }
    
    if ($air_row_2 == "Pages")
    {
    	$air_row_2_page_1 = get_option("air_row_2_page_1");
    	$my_query = new WP_Query("page_id=$air_row_2_page_1");
    	while ($my_query->have_posts()) : $my_query->the_post();
    	$content = get_the_content_with_formatting();
    	$images = get_all_img_urls($content);
    	$resized = vt_resize( '', $images[0] , 300, 180, true );
    	if(!empty($post->post_excerpt)) {
                 //This post have an excerpt, let's display it
                 $excerpt = get_the_excerpt();
             } else {
                 // This post have no excerpt
                $excerpt = better_excerpt($content, 24);
             }
    	?>
        <div class="one-third home-entry">
        <?php if ($images) { ?>
    		<img src="<?php echo $resized[url]; ?>" width="300" height="180" class="shadow" alt="" />
        <?php } ?>
    		<h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    		<p><?php echo $excerpt; ?></p>
    	</div><!--END one-third-->
    
        <?php
    	endwhile;
    
    	$air_row_2_page_2 = get_option("air_row_2_page_2");
    	$my_query = new WP_Query("page_id=$air_row_2_page_2");
    	while ($my_query->have_posts()) : $my_query->the_post();
    	$content = get_the_content_with_formatting();
    	$images = get_all_img_urls($content);
    	$resized = vt_resize( '', $images[0] , 300, 180, true );
    	if(!empty($post->post_excerpt)) {
                 //This post have an excerpt, let's display it
                 $excerpt = get_the_excerpt();
             } else {
                 // This post have no excerpt
                $excerpt = better_excerpt($content, 24);
             }
    	?>
        <div class="one-third home-entry">
    	<?php if ($images) { ?>
    		<img src="<?php echo $resized[url]; ?>" width="300" height="180" class="shadow" alt="" />
        <?php } ?>
    		<h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    		<p><?php echo $excerpt; ?></p>
    	</div><!--END one-third-->
        <?php
    	endwhile;
    
    	$air_row_2_page_3 = get_option("air_row_2_page_3");
    	$my_query = new WP_Query("page_id=$air_row_2_page_3");
    	while ($my_query->have_posts()) : $my_query->the_post();
    	$content = get_the_content_with_formatting();
    	$images = get_all_img_urls($content);
    	$resized = vt_resize( '', $images[0] , 300, 180, true );
    	if(!empty($post->post_excerpt)) {
                 //This post have an excerpt, let's display it
                 $excerpt = get_the_excerpt();
             } else {
                 // This post have no excerpt
                $excerpt = better_excerpt($content, 24);
             }
    	?>
        <div class="one-third home-entry last">
    	<?php if ($images) { ?>
    		<img src="<?php echo $resized[url]; ?>" width="300" height="180" class="shadow" alt="" />
        <?php } ?>
    		<h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    		<p><?php echo $excerpt; ?></p>
    	</div><!--END one-third-->
        <?php
    	endwhile;
    }
    ?><div class="divider"></div><?php
    }
    ?>
    
    <?php
    $air_row_3 = get_option("air_row_3");
    if ($air_row_3 != "Nothing")
    {
    ?>
    	<div class="overline"><h2><?php echo get_option("air_row_3_title"); ?> / <a href="<?php echo get_option("air_row_3_link_url"); ?>"><?php echo get_option("air_row_3_link_text"); ?></a></h2></div>
    
    <?php
    if ($air_row_3 == "Category articles" || $air_row_3 == "Portfolio articles")
    {
    	$i = 0;
    	$air_row_3_category = get_option("air_row_3_category");
    	$my_query = new WP_Query("cat=$air_row_3_category&posts_per_page=3");
    	while ($my_query->have_posts()) : $my_query->the_post();
    	$i++;
    	$content = get_the_content_with_formatting();
    	$images = get_all_img_urls($content);
    	$resized = vt_resize( '', $images[0] , 300, 180, true );
    	if(!empty($post->post_excerpt)) {
                 //This post have an excerpt, let's display it
                 $excerpt = get_the_excerpt();
             } else {
                 // This post have no excerpt
    			$excerpt = better_excerpt($content, 24);
             }
    	?>
    	<div class="one-third home-entry <?php if ($i == 3) echo " last"?>">
        <?php if ($air_row_3 == "Portfolio articles") { ?>
    
    		<img src="<?php echo $resized[url]; ?>" width="300" height="180" class="shadow" alt="" />
    		<h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
        	<?php }
    		if ($air_row_3 == "Category articles") {
    		?>
            <div class="post-meta">
    			<?php the_time('F jS, Y') ?> <?php if (comments_open()) { echo " - "; comments_popup_link('No Comments', '1 Comment', '% Comments'); } ?>
    		</div><!--END meta-->
    		<h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    		<p><?php echo $excerpt; ?></p>
    
            <?php } ?>
    	</div><!--END one-third-->
        <?php
    	endwhile;
    }
    
    if ($air_row_3 == "Pages")
    {
    	$air_row_3_page_1 = get_option("air_row_3_page_1");
    	$my_query = new WP_Query("page_id=$air_row_3_page_1");
    	while ($my_query->have_posts()) : $my_query->the_post();
    	$content = get_the_content_with_formatting();
    	$images = get_all_img_urls($content);
    	$resized = vt_resize( '', $images[0] , 300, 180, true );
    	if(!empty($post->post_excerpt)) {
                 //This post have an excerpt, let's display it
                 $excerpt = get_the_excerpt();
             } else {
                 // This post have no excerpt
                $excerpt = better_excerpt($content, 24);
             }
    	?>
        <div class="one-third home-entry">
        <?php if ($images) { ?>
    		<img src="<?php echo $resized[url]; ?>" width="300" height="180" class="shadow" alt="" />
        <?php } ?>
    		<h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    		<p><?php echo $excerpt; ?></p>
    	</div><!--END one-third-->
    
        <?php
    	endwhile;
    
    	$air_row_3_page_2 = get_option("air_row_3_page_2");
    	$my_query = new WP_Query("page_id=$air_row_3_page_2");
    	while ($my_query->have_posts()) : $my_query->the_post();
    	$content = get_the_content_with_formatting();
    	$images = get_all_img_urls($content);
    	$resized = vt_resize( '', $images[0] , 300, 180, true );
    	if(!empty($post->post_excerpt)) {
                 //This post have an excerpt, let's display it
                 $excerpt = get_the_excerpt();
             } else {
                 // This post have no excerpt
                $excerpt = better_excerpt($content, 24);
             }
    	?>
        <div class="one-third home-entry">
    	<?php if ($images) { ?>
    		<img src="<?php echo $resized[url]; ?>" width="300" height="180" class="shadow" alt="" />
        <?php } ?>
    		<h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    		<p><?php echo $excerpt; ?></p>
    	</div><!--END one-third-->
        <?php
    	endwhile;
    
    	$air_row_3_page_3 = get_option("air_row_3_page_3");
    	$my_query = new WP_Query("page_id=$air_row_3_page_3");
    	while ($my_query->have_posts()) : $my_query->the_post();
    	$content = get_the_content_with_formatting();
    	$images = get_all_img_urls($content);
    	$resized = vt_resize( '', $images[0] , 300, 180, true );
    	if(!empty($post->post_excerpt)) {
                 //This post have an excerpt, let's display it
                 $excerpt = get_the_excerpt();
             } else {
                 // This post have no excerpt
                $excerpt = better_excerpt($content, 24);
             }
    	?>
        <div class="one-third home-entry last">
    	<?php if ($images) { ?>
    		<img src="<?php echo $resized[url]; ?>" width="300" height="180" class="shadow" alt="" />
        <?php } ?>
    		<h2 class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    		<p><?php echo $excerpt; ?></p>
    	</div><!--END one-third-->
        <?php
    	endwhile;
    }
    ?><div class="divider"></div><?php
    }
    ?>
    
    </div><!--END content-->
    
    </div><!--END wrapper-->     
    
    <?php get_footer(); ?>
7 reacties aan het bekijken - 1 tot 7 (van in totaal 7)
  • Niet zo moeilijk 🙂
    1.Kijk even in de bron (rechtermuisknop/bron bekijken)
    2.Kijk in de bron naar de tag die de opmaak maakt voor de latest projects. (als je hier een link had gezet kon ik het aangeven)
    3.Vervolgens ga je in de style.css bij de tag het volgende bijzetten: display:none; en het is weg
    Niet in de PHP rommelen..

    Shmoo

    (@macpresss)

    Die code die je nu geeft is van de Slider of Slideshow welke waarschijnlijk op de homepage staat.

    Kijk eens in het bestand footer.php

    Thread starter hannevelde

    (@hannevelde)

    Het gaat om http://www.apartmentsatcaribbeancourt.com. Het gedeelte onder de slider, boven de footer, wil ik dus weg hebben. Ik heb nu het style.css bestand aangepast zoals Robelia voorstelde (display:none; bij #content tag), maar er is nog niks veranderd..

    Bedankt voor het meedenken!

    Thread starter hannevelde

    (@hannevelde)

    Verrek! Toch gelukt op de manier van Robelia, dank!

    Thread starter hannevelde

    (@hannevelde)

    Hmm, iets te vroeg gejuicht. Door display:none; bij de #content tag te plaatsen is alle pagina content verdwenen. Is er nog een andere manier om alleen het deel onder de slider te doen verdwijnen?

    Je moet deze hebben:
    <div class=”overline”> (goed kijken in de bron!)
    Dus in style.css
    #overline {display:none;}
    Komt 3 keer voor

    Thread starter hannevelde

    (@hannevelde)

    Nogmaals dank! Ik gebruikte dezelfde tag ook voor de titels op de pagina’s, dus het is wel jammer dat ik die nu kwijt ben, maar goed.. Dan maar zonder!

7 reacties aan het bekijken - 1 tot 7 (van in totaal 7)
  • Het onderwerp ‘"Latest projects" uit code slopen?’ is gesloten voor nieuwe reacties.