Title: janew's Replies | WordPress.org

---

# janew

  [  ](https://wordpress.org/support/users/janew/)

 *   [Profile](https://wordpress.org/support/users/janew/)
 *   [Topics Started](https://wordpress.org/support/users/janew/topics/)
 *   [Replies Created](https://wordpress.org/support/users/janew/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/janew/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/janew/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/janew/engagements/)
 *   [Favorites](https://wordpress.org/support/users/janew/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 44 total)

1 [2](https://wordpress.org/support/users/janew/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/janew/replies/page/3/?output_format=md) 
[→](https://wordpress.org/support/users/janew/replies/page/2/?output_format=md)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [link only images that are bigger](https://wordpress.org/support/topic/link-only-images-that-are-bigger/)
 *  Thread Starter [janew](https://wordpress.org/support/users/janew/)
 * (@janew)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/link-only-images-that-are-bigger/#post-13854919)
 * Fair enough, but I want it to link only when the original image is larger than
   the “Large” size set in Media settings. Maybe that part is mixing things up.
 * I guess I should be asking for it to link images if the original image is wider
   than the max content-width. In that regard, nothing changes from browser to browser.
   Whether the viewport is 240px or 2400px, the content-width is always limited 
   to 800px, and therefore the largest the image can be displayed is 800px. And 
   I want to link to images that are larger than that.
 * It’s my understanding that WordPress “knows” how big the original image is, so
   it can know if it is bigger than the max content-width and if it should link 
   to it or not.
 * I just don’t have any idea how to tell it to do so, in functions.php. Or if it’s
   even possible.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [link only images that are bigger](https://wordpress.org/support/topic/link-only-images-that-are-bigger/)
 *  Thread Starter [janew](https://wordpress.org/support/users/janew/)
 * (@janew)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/link-only-images-that-are-bigger/#post-13854506)
 * I don’t understand. At the time of linking, the following code is inserted into
   the post:
 * `<a href="http://www.foo.com/wp-content/uploads/2020/12/image.jpg"><img src="
   http://www.foo.com/wp-content/uploads/2020/12/image-800x1159.jpg" alt="" width
   ="800" height="1159" class="alignnone size-large wp-image-1346" /></a>`
 * Regardless of device, the image loaded has the size appended: 800×1159 – which
   means the original is larger than the image displayed and can be linked to. If
   there is no size appended to the image, then it is already showing the original
   and does not need to be linked.
 * So even if the user is viewing on a phone with a 240px width, it is still showing
   the image with the 800×1159 size, just showing it smaller, so it fits on the 
   device screen. But the picture itself is still 800px wide. Right?
 * If I’m wrong, please explain, because that is how I understand this to work.
 * With regard to content-width, I have already re-defined that to 800px, so there
   is no issue with that ever overriding my Media settings.
 * Thanks!
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[Twenty Twenty] Navigate within same category](https://wordpress.org/support/topic/navigate-within-same-category/)
 *  Thread Starter [janew](https://wordpress.org/support/users/janew/)
 * (@janew)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/navigate-within-same-category/#post-13835534)
 * Nevermind! lol
 * That *does* work – I was just testing it on the wrong page! 🙄
 * For an even shorter version, do this:
    $next_post = get_next_post(true); $prev_post
   = get_previous_post(true);
 * Posting in case it helps someone else.
 * Thanks!
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[Twenty Twenty] Navigate within same category](https://wordpress.org/support/topic/navigate-within-same-category/)
 *  Thread Starter [janew](https://wordpress.org/support/users/janew/)
 * (@janew)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/navigate-within-same-category/#post-13835530)
 * I am trying to avoid using plugins as much as possible.
 * Why doesn’t this work:
 *     ```
       $next_post = get_next_post($in_same_term = true, $excluded_terms = '', $taxonomy = 'category');
       $prev_post = get_previous_post($in_same_term = true, $excluded_terms = '', $taxonomy = 'category');
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [adding date/time to tooltip](https://wordpress.org/support/topic/adding-date-time-to-tooltip/)
 *  Thread Starter [janew](https://wordpress.org/support/users/janew/)
 * (@janew)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/adding-date-time-to-tooltip/#post-13832078)
 * Sorry didn’t mean to imply that you were giving styling advice … everything I
   googled wanted to tell me how to style it and I didn’t want you to waste your
   time explaining all that in case that’s what you thought I was looking for, since
   you said you didn’t understand.
 * Anyway, the code you provided is a good starting point, and I was able to “fix”
   it to my needs.
 * First off, I figured out the `$` lines need to go before the `if` statement. 
   And in the span the first php should read `$dateis`. I thought putting `echo`
   before `the_title` might screw it up, but it did not – but neither did removing
   it altogether. So I guess it’s unnecessary, sometimes….
    Once I got that fixed
   there was one other major problem: it was only showing the current date and time,
   and changed on every reload. Some digging – and trial and error – had me realizing
   that the `$` lines needed to read as
 *     ```
       $dateis=get_the_date();
       $timeis=get_the_time();
       ```
   
 * Once I did that, the post date was then showing in the tool tip, as I want.
 * So thank you for putting me on the right track!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [adding date/time to tooltip](https://wordpress.org/support/topic/adding-date-time-to-tooltip/)
 *  Thread Starter [janew](https://wordpress.org/support/users/janew/)
 * (@janew)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/adding-date-time-to-tooltip/#post-13831946)
 * [@corrinarusso](https://wordpress.org/support/users/corrinarusso/) Yes that’s
   a form of tool tip, though styled a bit, I guess. I’m not looking for styling
   advice though, just want to make it work using the html title attribute.
    [https://ibb.co/PF7Mdnn](https://ibb.co/PF7Mdnn)
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Show one post from certain category](https://wordpress.org/support/topic/show-one-post-from-certain-category/)
 *  Thread Starter [janew](https://wordpress.org/support/users/janew/)
 * (@janew)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/show-one-post-from-certain-category/#post-13831489)
 * That’s it!
    After this code in the original, there is a bunch of mixed html/php
   that I didn’t need, followed by the usual `get_footer();`, so I completely missed
   the `endwhile;` that was buried in between. And since it wasn’t in the code I
   was replacing, I didn’t even think about it.
 * Thank you for explaining that the colon replaces the opening brace – I wasn’t
   aware of that, and now it makes more sense as I never really understood why `
   endwhile;` would only show up sometimes.
 * Thank you so much!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Jetpack - WP Security, Backup, Speed, & Growth] Error and Warning](https://wordpress.org/support/topic/error-and-warning-2/)
 *  Thread Starter [janew](https://wordpress.org/support/users/janew/)
 * (@janew)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/error-and-warning-2/#post-13824376)
 * Original post error message copied from Chrome. This is Firefox:
 *     ```
       Uncaught SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
           onload jQuery
           send https://widgets.wp.com/likes/master.html?ver=202052#ver=202052&lang=en-ca:1
           jQuery 7
               displayWidget
               ajax
               success
               makeProxyCall
               execute
               resolve
               receive
       ```
   
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [[Twenty Twenty] renovate comments section](https://wordpress.org/support/topic/renovate-comments-section/)
 *  Thread Starter [janew](https://wordpress.org/support/users/janew/)
 * (@janew)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/renovate-comments-section/#post-13824070)
 * Nevermind! lol
 * I have found workarounds and a great code from [@alexmoise](https://wordpress.org/support/users/alexmoise/)(
   referenced in link above), to which I added the ‘cookies’ field. This is the 
   full, slightly modified code:
 *     ```
       // comment form fields re-defined:
       add_filter( 'comment_form_default_fields', 'mo_comment_fields_custom_html' );
       function mo_comment_fields_custom_html( $fields ) {
       	// first unset the existing fields:
       	unset( $fields['comment'] );
       	unset( $fields['author'] );
       	unset( $fields['email'] );
       	unset( $fields['url'] );
       	unset( $fields['cookies'] );
       	// then re-define them as needed:
       	$fields = [
       		'comment_field' => '<p class="comment-form-comment"><label for="comment">' . _x( 'A CUSTOM COMMENT LABEL', 'noun', 'textdomain' ) . '</label> ' .
       			'<textarea id="comment" name="comment" cols="45" rows="8" maxlength="65525" aria-required="true" required="required"></textarea></p>',
       		'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'A CUSTOM NAME LABEL', 'textdomain'  ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
       			'<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30" maxlength="245"' . $aria_req . $html_req . ' /></p>',
       		'email'  => '<p class="comment-form-email"><label for="email">' . __( 'A CUSTOM EMAIL LABEL', 'textdomain'  ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
       			'<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30" maxlength="100" aria-describedby="email-notes"' . $aria_req . $html_req  . ' /></p>',
       		'cookies'	=> '<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes" />&nbsp;<label for="wp-comment-cookies-consent">Save my name and email in this browser for the next time I comment.</label></p>',
       		'url'    => '<p class="comment-form-url"><label for="url">' . __( 'A CUSTOM WEBSITE LABEL', 'textdomain'  ) . '</label> ' .
       			'<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" maxlength="200" /></p>',
       	];
       	// done customizing, now return the fields:
       	return $fields;
       }
       // remove default comment form so it won't appear twice; leave it if user is already logged in
       add_filter( 'comment_form_defaults', 'mo_remove_default_comment_field', 10, 1 ); 
   
       function mo_remove_default_comment_field( $defaults ) { 
       	if ( !is_user_logged_in() ) {
       		if ( isset( $defaults[ 'comment_field' ] ) ) { 
       			$defaults[ 'comment_field' ] = ''; 
       		}
       	}
       	return $defaults; 
       }
       ```
   
 * I used css to hide the display of the comment-notes section and simply added “(
   will not be published)” note after the Email label. Hiding Website field makes
   all fields required and, though I didn’t figure out a way to add an “all fields
   required” notice (it’s probably simple but I’m sick of dealing with this so not
   even gonna try) I think it’s implied.
 * Hope this helps someone else! All credit to [@alexmoise](https://wordpress.org/support/users/alexmoise/)!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Resetting comment field in code](https://wordpress.org/support/topic/resetting-comment-field-in-code/)
 *  Thread Starter [janew](https://wordpress.org/support/users/janew/)
 * (@janew)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/resetting-comment-field-in-code/#post-13824030)
 * [@alexmoise](https://wordpress.org/support/users/alexmoise/) That’s perfect!
 * I was sooo close to figuring this out. lol
 * I figured it had to be this way but couldn’t think how to write `is_user_not_logged_in`,
   and totally forgot about the ! – I can understand it when it shows up in code
   I am reading, but I can never remember those symbols to write them.
 * So everything is how I envisioned, except I think I would have made the mistake
   of leaving the last line `return $defaults` within the isset area – which is 
   to say I would have had two braces after that line instead of one.
 * So thank you very much for this, and for the rest of the code that it belongs
   to. It’s all super fantastic. I wish WordPress was easier to customize in this
   way, but maybe it just isn’t possible.
 * Thank you!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Jetpack - WP Security, Backup, Speed, & Growth] Error and Warning](https://wordpress.org/support/topic/error-and-warning-2/)
 *  Thread Starter [janew](https://wordpress.org/support/users/janew/)
 * (@janew)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/error-and-warning-2/#post-13821053)
 * Yes, fully up to date WordPress and Jetpack. Error and Warning both occur with
   all other plugins disabled. Running TwentyTwenty with a child theme. Shows on
   Post not on Page.
    Sorry, can’t share the link.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Change “Comments” form (bis)](https://wordpress.org/support/topic/change-comments-form-bis/)
 *  [janew](https://wordpress.org/support/users/janew/)
 * (@janew)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/change-comments-form-bis/#post-13819461)
 * Hi [@alexmoise](https://wordpress.org/support/users/alexmoise/) I am also using
   this excellent code you provided on another thread. That topic is closed, so 
   I am adding to this one, which is wrong but still related so hopefully I don’t
   get in trouble!
 * So, at the bottom of this code is a function to remove the default comment field
   so it won’t appear twice. Unfortunately the result of this is that, while people
   not logged in will see my form as I want it to be seen, people already logged
   in see no comment area to fill in.
 * How can I set that last bit to only suppress the default if someone is *not* 
   logged in?
 * Thanks!
    -  This reply was modified 5 years, 7 months ago by [janew](https://wordpress.org/support/users/janew/).
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [renovate comments area part 2](https://wordpress.org/support/topic/renovate-comments-area-part-2/)
 *  Thread Starter [janew](https://wordpress.org/support/users/janew/)
 * (@janew)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/renovate-comments-area-part-2/#post-13813113)
 * Done, thanks!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [renovate comments area part 2](https://wordpress.org/support/topic/renovate-comments-area-part-2/)
 *  Thread Starter [janew](https://wordpress.org/support/users/janew/)
 * (@janew)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/renovate-comments-area-part-2/#post-13813085)
 * [@t-p](https://wordpress.org/support/users/t-p/)
    Are these not all WordPress
   things? These are all changes to the comment_form which comes from wp-includes,
   not the theme. None of it is theme-specific. Is it? And it’s twentytwenty theme,
   which is generated by WordPress as well, sooo…. 🤷‍♀️
 * Happy to take it elsewhere, just seems like this is the best place to get the
   answers I’m looking for. Let me know if I’m wrong.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [renovate comments area part 2](https://wordpress.org/support/topic/renovate-comments-area-part-2/)
 *  Thread Starter [janew](https://wordpress.org/support/users/janew/)
 * (@janew)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/renovate-comments-area-part-2/#post-13813079)
 * Add: In case it’s a concern, I am removing the url field entirely from the comments
   form
    `p.comment-form-url {display: none; }` So requiring all fields is just 
   requiring name and email. Thanks!

Viewing 15 replies - 1 through 15 (of 44 total)

1 [2](https://wordpress.org/support/users/janew/replies/page/2/?output_format=md)
[3](https://wordpress.org/support/users/janew/replies/page/3/?output_format=md) 
[→](https://wordpress.org/support/users/janew/replies/page/2/?output_format=md)