Jump to content

Word Press PHP Coding


glynedwards

Recommended Posts

Hey,

 

This is my first post in PHP Freaks, nice to meet you all in advance.

 

My question is this...

 

Here is my website for my band www.mairmetal.com, on the home page you have "Upcoming Gigs". Due to it being a blogging platform the date of when I posted the next gig event can be confusing to the actual event date... you'll understand when you see it...

 

Is there a way to remove the date by changing the PHP coding?

 

<?php

          $cat = ($r_option['recent_posts_category'] != '_all') ? $cat = $r_option['recent_posts_category'] : $cat = '0';

  $q = 'cat='.$cat.'&post_status=future,publish';

  $wp_query = new WP_Query();

  $wp_query->query($q);

  ?>

          <?php if (have_posts()) : ?>

          <?php while (have_posts()) : the_post(); ?>

          <?php

  $post_thumb = get_post_meta($wp_query->post->ID, '_post_thumb', true);

          $custom_day = get_post_meta($wp_query->post->ID, 'custom_day', true);

          $custom_month = get_post_meta($wp_query->post->ID, 'custom_month', true); ?>

            <div class="news-entry pngfix">

              <div><span class="day"><?php if ($custom_day != '') echo $custom_day; else the_time('d'); ?></span><span class="year"><?php if ($custom_month != '') echo $custom_month; else the_time('m/y'); ?></span></div>

              <a href="<?php the_permalink();?>" <?php if ($post_thumb && $post_thumb != '') echo 'class="tooltip"';?> rel="<?php echo r_image_resize(200, 200, $post_thumb); ?>"><?php echo get_the_title();?></a>

              </div>

          <?php endwhile; ?>

          <?php endif; ?>

          </div>

        </div>

      </div>

      <div id="hb-col3">

 

Kind Regards

 

Glyn

Link to comment
Share on other sites

Hi.

 

I think you just have to remove this code.

 

<?php

  $cat = ($r_option['recent_posts_category'] != '_all') ? $cat = $r_option['recent_posts_category'] : $cat = '0';

$q = 'cat='.$cat.'&post_status=future,publish';

$wp_query = new WP_Query();

$wp_query->query($q);

?>

  <?php if (have_posts()) : ?>

  <?php while (have_posts()) : the_post(); ?>

  <?php

$post_thumb = get_post_meta($wp_query->post->ID, '_post_thumb', true);

  $custom_day = get_post_meta($wp_query->post->ID, 'custom_day', true);

  $custom_month = get_post_meta($wp_query->post->ID, 'custom_month', true); ?>

<div class="news-entry pngfix">

  <div><span class="day"><?php if ($custom_day != '') echo $custom_day; else the_time('d'); ?></span><span class="year"><?php if ($custom_month != '') echo $custom_month; else the_time('m/y'); ?></span></div>

  <a href="<?php the_permalink();?>" <?php if ($post_thumb && $post_thumb != '') echo 'class="tooltip"';?> rel="<?php echo r_image_resize(200, 200, $post_thumb); ?>"><?php echo get_the_title();?></a>

  </div>

  <?php endwhile; ?>

  <?php endif; ?>

  </div>

</div>

</div>

<div id="hb-col3">

Link to comment
Share on other sites

Thanks mate, thats fixed it!

 

The date at when it was posted has been removed.

 

The text for each post is now lying over the grey horizontal box... any thoughts? www.mairmetal.com

 

<?php

/*

Template Name: Homepage

*/

?>

  <?php get_header(); ?>

 

  <?php global $r_option; ?>

 

  <?php include_once(THEME.'/includes/intro.php'); ?>

  <div id="slider-wrap" class="pngfix">

  <?php

  $r_slider = new r_slider();

  $r_slider->options = array(

'option_name' => $r_option['homepage_slider'],

'id' => 'rs',

'image_width' => 940,

'image_height' => 380,

'delay' => $r_option['rslider_delay'],

'duration' => $r_option['rslider_duration'],

'transition' => $r_option['rslider_transition'],

'easing' => $r_option['rslider_easing'],

);

  $r_slider->display();

  ?>

  </div>

  <!-- start homepage boxes -->

  <div class="content">

    <div id="hb">

   

      <div id="hb-col1" <?php if ($r_option['wide_text_box'] == 'on') echo 'class="col1-wide"'; ?>>

        <h1><?php echo $r_option['text_box_heading']; ?></h1>

      <?php echo do_shortcode($r_option['text_box']); ?>

      </div>

      <?php if ($r_option['wide_text_box'] == 'off') : ?>

      <div id="hb-col2">

        <h3><?php echo $r_option['recent_posts_heading']; ?></h3>

        <div class="news-wrap"> <span class="news-up"></span><span class="news-down"></span>

          <div class="news">

          <?php

          $cat = ($r_option['recent_posts_category'] != '_all') ? $cat = $r_option['recent_posts_category'] : $cat = '0';

  $q = 'cat='.$cat.'&post_status=future,publish';

  $wp_query = new WP_Query();

  $wp_query->query($q);

  ?>

          <?php if (have_posts()) : ?>

          <?php while (have_posts()) : the_post(); ?>

          <?php

  $post_thumb = get_post_meta($wp_query->post->ID, '_post_thumb', true);

          $custom_day = get_post_meta($wp_query->post->ID, 'custom_day', true);

          $custom_month = get_post_meta($wp_query->post->ID, 'custom_month', true); ?>

            <div class="news-entry pngfix">

             

              <a href="<?php the_permalink();?>" <?php if ($post_thumb && $post_thumb != '') echo 'class="tooltip"';?> rel="<?php echo r_image_resize(200, 200, $post_thumb); ?>"><?php echo get_the_title();?></a>

              </div>

          <?php endwhile; ?>

          <?php endif; ?>

          </div>

        </div>

      </div>

      <div id="hb-col3">

      <h3><?php echo $r_option['recent_works_heading']; ?></h3>

        <div id="recent-wrap">

          <div id="recent" class="pngfix">

<?php

            $r_recent_slider = new r_slider();

            $r_recent_slider->options = array(

                                              'option_name' => $r_option['portfolio_manager'],

                                              'id' => 'recent-slider',

                                              'image_width' => 210,

                                              'image_height' => 210,

  'category' => $r_option['recent_works_category'],

  'limit' => $r_option['recent_works_limit'],

                                              'desc' => false,

                                              'delay' => 10,

                                              'duration' => 500,

                                              'transition' => 'horizontal',

                                              'easing' => 'easeOutQuart',

                                              );

            $r_recent_slider->display();

            ?>

          </div>

        </div>

      </div>

      <?php endif; // End wide text box ?>

    </div>

    <div class="clear"></div>

  </div>

  <!-- end homepage boxes-->

 

  <?php get_footer(); ?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.