• I need some assistance with WordPress.

    This is my first time making a wordpress site from scratch and I’m not a developer, just trying to help out.

    the site at the moment is https://www.bistromint.com.au/wp

    I need to do 3 things.

    1. Make the 3 text areas individual static posts editable in WordPress admin and
    2. Remove date stamp, author, and comments from each post.
    3. Make the posts static and not able to click them and go to a individual blog post.

    Any help is more than welcomed.

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • For question 1, I don’t know what your intention. Can you be more specific?

    For question 2, you can remove date stamp, author, comment by editing content.php. See this video

    For question 3, in content.php, simply remove a tag with href the_permalink(). Leave only the_title() in h1 tag.

    Thread Starter nevewers

    (@nevewers)

    I suppose the best way to explain is I need multiple loops on the same for individual posts.

    So on Index.php i need 3 different ppost to show in 3 different areas of the page

    Ok, I understand now. The way you can achieve this by creating 3 categories. And then using WP_Query to loops for each categories.

    Thread Starter nevewers

    (@nevewers)

    I got the headers to show but the post content isn’t showing, can you look at the code and tell me what else I could try?

    <?php
    get_header();
    ?>
    </div>
    <div class="gal_1">
     <?php
     $query1 = new WP_Query( 'category_name=1&showposts=1' );
    
    // The Loop
    while ( $query1->have_posts() ) {
            $query1->the_post();
    }
    
    wp_reset_postdata(); 
    
    ?>
    </div>
    <div class="strip"></div>
    <div class="content">
    	<?php
    	$query2 = new WP_Query( 'category_name=2&showposts=1' );
    
    // The 2nd Loop
    while( $query2->have_posts() ) {
            $query2->next_post();
            echo '<h2>' . get_the_title( $query2->post->ID ) . '</h2>';
    }
    
    wp_reset_postdata(); ?>
    </div>
    <div class="strip"></div>
    <div class="hero"><img src="img/hero.jpg" width="100%" height="651" alt=""></div>
    <div class="strip"></div>
    <div class="container_w content_2">
    	<?php
    		$query3 = new WP_Query( 'category_name=3&showposts=1' );
    
    // The 3rd Loop
    while( $query3->have_posts() ) {
            $query3->next_post();
            echo '<h1>' . get_the_title( $query3->post->ID ) . '</h1>';
    }
    
    wp_reset_postdata(); ?></div>
    <?php get_footer(); ?>

    Take a look at your query parameter WP_Query. You supplied ID for category. If you want to use ID, use cat=1. If you want to use category_name, use category slug like category_name=news

    For example :

    <div class="area1">
      <?php
          $args = array(
    	'post_type'     => 'post',
    	'category_name' => 'review'
          );
    
    	$query1 = new WP_Query( $args );
    
    	while($query1->have_posts()) : $query1->the_post();
    		the_title();
    	endwhile;
    
    	wp_reset_postdata();
      ?>
    </div>
    
    <div class="area2">
      <?php
          $args = array(
    	'post_type'     => 'post',
    	'category_name' => 'news'
          );
    
    	$query2 = new WP_Query( $args );
    
    	while($query2->have_posts()) : $query2->the_post();
    		the_title();
    	endwhile;
    
    	wp_reset_postdata();
      ?>
    </div>
    
    <div class="area3">
      <?php
          $args = array(
    	'post_type'     => 'post',
    	'category_name' => 'review'
          );
    
    	$query3 = new WP_Query( $args );
    
    	while($query3->have_posts()) : $query3->the_post();
    		the_title();
    	endwhile;
    
    	wp_reset_postdata();
      ?>
    </div>
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adding Posts to a static site’ is closed to new replies.