Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi adam.codefor,

    I just had the same problem. For me it was a plugin that was causing problems. Luckily one of my own so I could resolve the issue. The problem is that the plugin calls the get_pages() function and that that array gets cached so the wp_list_pages() function will read that cache instead of fetching it out of the database. For some reason the current_page_ancestor class doesn’t get set then.

    The only thing I could do was flushing the cache (=wp_cache_flush()) to force WP to rebuild the cache and then it worked.

    Hi, about that tinyMCE problem.
    I was just having the same problem.

    I figured out that the initialization function of tinyMCE loaded after my own initialization function (on document load) so I set a small delay to add the controls to the textareas. Something like this:

    jQuery(function(){
      window.setTimeout( function(){
        jQuery("textarea.mceEditor").each(function(i){
            this.id = "mceEditor" + (i + 1);
            tinyMCE.execCommand("mceAddControl", false, this.id);
        });
      }, 100);
    });

    To my surprise this worked. The only problem is that it keeps loading in FF. You can do everything but the spinner keeps on going.

    Forum: Plugins
    In reply to: divide loop by days

    You can delete the while loop because it doens’t do anything anymore.

    i still want to know how to change the date to “today” and “yesterday”.

    switch(true)
    {
          case $post->post_date >= strtotime("today"):
              $datestr = "Today";
          break;
          case $post->post_date >= strtotime("yesterday"):
              $datestr = "Yesterday";
          break;
          default:
              $datestr = date( "F j, Y" , strtotime( $post->post_date ) );
    ;
          break;
    }

    What do you mean with hidden links?

    Forum: Plugins
    In reply to: divide loop by days
    <?php
    $prev_date = null;
    $posts = get_posts(array('orderby'=>'post_date'));
    foreach( $posts as $post ):
    $date = date( "F j, Y" , strtotime( $post->post_date ) );
    if( $date != $prev_date ): ?>
    <h3><?php echo $date ?></h3>
    <?php
    $prev_date = $date;
     endif; ?>
    <div><?php echo $post->post_content ?></div>
    <?php endforeach; ?>
Viewing 5 replies - 1 through 5 (of 5 total)