Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • I was faced with a similar problem and solved it in 2 steps:

    1) by adding $this->pagelink = get_permalink( $gallery->pageid ); in image.php (~line 65)

    2) by changing the widget.php link-output in line 394 from $image->imageURL to $image->pagelink

    Hi,
    you might solve your problem by adding a parameter to your link-URL like “&special=true” which then can be checked in the single-template.

    get my drift?

    Have a look at this plugin, it enables you to include raw php-functions in a widget.

    Hi Digi,

    I pasted the function into the functions.php file.
    Is that the thing to do?

    Yes! Although you’ll have to update it with the version below.

    How do I call this function in my text to make the last updated date appear there?

    You have to put this in your template at the desired place:
    <?php site_last_updated('') ?>

    And finally a version of my funtion, that actually does it’s job properly:

    /* site_last_updated
    *
    * This will check the modified_date of all published posts and give you the most recent date.
    *
    */
    function site_last_updated($d = '') {
    	$recent = new WP_Query("showposts=1&orderby=modified&post_status=publish");
    	if ( $recent->have_posts() ) {
    		while ( $recent->have_posts() ) {
    			$recent->the_post();
    			$last_update = get_the_modified_date($d);
    		}
    		echo $last_update;
    	}
    	else
    		echo 'No posts.';
    }

    The function accepts the standard parameters for date/time-formatting.

    My function above didn’t do exactly what it was supposed to do and was too complicated anyway. Here’s the update:

    /* site_last_updated
    *
    * This will check the modified_date of all posts and give you the most recent date.
    *
    */
    function site_last_updated($d = '') {
    	$allposts = new WP_Query();
    	$allposts->query('orderby=modified&order=ASC');
    	if ( $allposts->have_posts() ) {
    		$allposts->the_post();
    		$last_update = the_modified_date($d);
    		echo $last_update;
    	}
    	else
    		echo 'No posts.';
    }

    That’s why the function isn’t called when_was_the_last_post_added! 😉
    If you edit an existing post, it doesn’t change the order of appearance on your site, but it’s well an update (in my eyes). That’s why it checks the modified_date of all posts, not only of the last post.

    this might help you:

    /* site_last_updated
    *
    * This will check the modified_date of all posts and echo the most recent date.
    *
    */
    function site_last_updated($d = '') {
      $last_update = 0;
      if ( have_posts() ) :
        while ( have_posts() ) :
          the_post();
          // check for current post's modified_date
          if (get_the_modified_date('U') > $last_update) {
            $last_update = get_the_modified_date('U');
          }
        endwhile;
        // format output
        if ( '' == $d )
          $last_update = date(get_option('date_format'), $last_update);
        else
          $last_update = date($d, $last_update);
        // output
        echo $last_update;
      else:
        echo 'No posts.';
      endif;
    }

    Hi there,

    it’s much easier than you think – no css needed whatsoever.
    When you set up your contact form you can directly give extra information within the brackets. To change the cols from 40 to say 25 it should look like this:
    [text* your-name 25/]

    To get the right format, just play with the “generate tag” on the right side and you’ll see how the different options are to be used.

    Should fit nicely in your sidebar!
    Greetz, Hannes

Viewing 9 replies - 1 through 9 (of 9 total)