Jump to content

OwlService

Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

OwlService's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you. Sometimes common sense deserts me! Thank you for taking the time. Much appreciated. Karl
  2. Hi there, Thank you for your time. I am no PHP coder, so please bare with me. I have the following code to display events on my page, but I want to change how date, event is displayed. Currently, it displays date in an H4 heading and directly below, the event title in an H5 heading. I want it to display in one line <h4> Weds 1 June : Interval Training</h4> i am sure this is a very basic thing to do, but I can't see it. This is my code: <!-- Event Code To Go Here ================================================== --> <div class="entry-content content"> <div class="main-am-events"> <?php $args = array( 'post_type' => 'am_event', 'post_status' => 'publish', 'orderby' => 'meta_value', 'meta_key' => 'am_startdate', 'order' => 'ASC', 'meta_query' => array( array( 'key' => 'am_enddate', 'value' => date('Y-m-d H:i:s', time()), 'compare' => ">", ), ), ); $the_query = new WP_Query($args); if ($the_query->have_posts()) { while ($the_query->have_posts()) { $the_query->the_post(); $postId = $post->ID; // GET EVENT DATA $startDate = am_get_the_startdate('l j F'); // DISPLAY EVENT CONTENT echo '<strong><h4>' . $startDate . '</h4></strong>'; the_title( '<h5>', '</h5>' ); the_content(); echo '<hr class="x-hr">'; } } wp_reset_query(); ?> </div><!-- end am-events --> Could anyone give me a heads up please? I appreciate your time. Thank you, Karl
  3. Thanks Guys. Explode worked just fine
  4. Hi all, My hosting company recently upgraded PHP and now I get an error saying Function split is now depreciated. Do you know what I need to do to fix the code below please? My original coder is no longer around Thank you. <?php $menu = <<<MENU <ul> <li><a href="/" title="Ely Museum homepage" accesskey="1">Home</a></li> <li><a href="/about/" title="All about Ely Museum">About Us</a></li> <li><a href="/information/" title="Visitor information for Ely Museum" accesskey="8">Visitor Information</a></li> <li><a href="/displays/" title="The displays at Ely Museum">Displays</a></li> <li><a href="/events/" title="The displays at Ely Museum">Events</a></li> <li><a href="/education/" title="Educational information abiut Ely Museum">Education</a></li> <li><a href="/contact/" title="Contact information for Ely Museum" accesskey="9">Contact</a></li> </ul> MENU; $lines = split("\n", $menu); foreach ($lines as $line) { $current = false; preg_match('/href="([^"]+)"/', $line, $url); if (substr($_SERVER["REQUEST_URI"], 0, 5) == substr($url[1], 0, 5)) { $line = str_replace('<a h', '<a id="active" h', $line); } echo $line."\n"; } ?>
×
×
  • 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.