How to change image resolution on selection of field type

I am creating a Content type and added field (like: category, image etc). I want to use different resolution default image for each category. As well as I want to restrict the user to upload specific resolution image while creating content of different categories of the same content type.

Can someone please tell me which type of redirect is this?

I have just came upon this site writing keyword youtube to mp3. The site shows different page in google but when clicked it redirects to its homepage. However the page which is indexed and shows in google is a blank page. Can someone please tell me which type of redirect is it?

payment methods – getting Please enter a valid credit card type number error Authorize.Net

I have used Authorize.Net Credit Card Payment Method,
suddenly it gives an error when entering the credit card number,
Please enter a valid credit card type number

I have found this text in files its giving path like,



I don’t know how to fix this issue,
Please help me on this.


computer architecture – How do I fix keys that type in the wrong key or don’t work at all?

there. If I have any grammical errors, it’s because I am just a mere child. Anyways, onto my problem. As you can tell by the title, my laptop is typing in the wrong keys. For example, the problem right now is that ‘backspace’ is typing in ‘*’. I am also experiencing a sticky key occurrence, even though I’m not repeatedly pressing a key. Every so, ‘+’ will automatically type in. For now, the only solution I can think of is to have someone who can find the problem. I haven’t done anything to mess it up, either than spilling soda on it. It wasn’t a bad spill, but it might’ve gotten into the keys and started turning sticky. I have tried placing it in rice, it worked on the numbers, letters, and symbols. The remaining keys(arrow keys, enter, shift)do not work.

If you have any suggestions, please reply. Thank you.

8 – Difference between render elements #type container and #type html_tag?

What is the difference between render elements of #type html_tag (set to div) and container in Drupal 8?

Is the container render element, a simpler version of html_tag? Easier for processing to preprocess container elements?

I note that:

Perhaps my theories are correct (easier to leave be for historical reason / form element reasons)?


  use DrupalCoreStringTranslationTranslatableMarkup;

  $variables('myhtml_tag') = (
    '#type' => 'html_tag',
    '#tag' => 'div',
    '#attributes' => (
      'class' => 'my-container-class1',
    'child' => (
      '#markup' => new TranslatableMarkup('Some Container text1.'),

  $variables('mycontainer') = (
    '#type' => 'container',
    '#attributes' => (
      'class' => 'my-container-class2',
    'child' => (
      '#markup' => new TranslatableMarkup('Some Container text2.'),


<div class="my-container-class1">Some Container text1.</div>

<div class="my-container-class2">Some Container text2.</div>

plugins – Custom Post type content not displaying on single page

I have added a select dropdown on my custom post type in the admin panel. Basically that is a select dropdown which is displaying my another custom post type title. I used below code.

$args = array( 'post_type'=>'blogauthor','post_status' => 'publish' );
    $recent_posts = wp_get_recent_posts($args);
    $getblogauthorId=get_post_meta(get_the_ID(), 'blogauthor', true );// get selected when hit URL page
    echo '<select name="blogauthor">
            <option  value="" selected="" disabled="">Select Author</option>';
    foreach( $recent_posts as $recent ){
        if($recent("ID")==$getblogauthorId){ $authselected='selected="selected"';};
        echo'<option value="' .$recent("ID").'" '.$authselected.'>' .   $recent("post_title").'</option> ';

There is no issue with above dropdown.

Now I am on single page and I have to show the content which I selected from the drodpwn.
what is the issue with below code because every time it’s run else part.

$blogauthorId=get_post_meta(get_the_ID(), 'blogauthor', true );
        $the_query =array(
          'post_type' => 'blogauthor',
          'post_status' => 'publish',
          'numberposts' => 1,
          'meta_key' => 'blogauthor',
          'meta_value' => $blogauthorId,
          'order'      => 'DESC'
        $authorData = new WP_Query($the_query);
        if ($authorData->have_posts()): while($authorData->have_posts()): $authorData->the_post();
        endwhile; else:
        echo "Please select author";


backup – Reliability of Type C vs. micro-USB vs. SD card

I don’t use cloud services. I just manually backup my phone using a rotation of a few SD cards I own, and when I have access to a family computer, I transfer what’s in those cards to the computer, in order to “double” backup.

(Not the best approach but works fine for me.)

A few years ago (pre-type-C being the norm), I tried to depart from SD cards (just for convenience, so that I wouldn’t have to remove and insert them to/from my SIM tray all the time) and gave some flash drives and external HD’s (via an OTG micro-USB cable) a chance, as they’re more “plug and play”.

Me being careful in general with my equipment and their cables, and always mindful about properly ejecting flash/hard drives, it’s safe to say I’ve almost never experienced corrupted files on a computer.

But that wasn’t the case on my phone. I tried both flash and hard drives (even with an externally powered OTG cable) and I’d encounter some corrupted files after moving them back and forth.

So I just figured micro-USB might be unreliable for this purpose and I went back to using SD cards.

Has type C been any different? Other than transfer speed (which is not my biggest concern) is it more reliable than micro-USB?

In terms of reliability alone where does it rank between micro-USB and SD cards? Am I better off with my SD cards as it is, or type C is reliable enough, for me to quit SD cards and start using it instead?

Like I said, type C’s transfer speed is less important than reliability, but it’s tempting nonetheless.

Is it possible to extend SPFieldUrl to have more properties like url or description, to create a custom field type?

Url field type has more than one property : something like url, description. I want to know that how can I extend url field type(or some other field type that have more than one property) to create a custom field type with more than one property?

8 – Date Field Type – Text Field Widget is Gone?

I am noticing that the Date field type only has the availability of three widgets:

  1. Select list
  2. Date and time
  3. Select list, no time

Can someone tell me why the “Text Field” widget is gone? Or am I missing something?

I have a use case where the user needs to be able to copy the date from another source and paste that value into the date field. It would be too time-consuming to have to pick the date from a “date picker” widget. It would be ok if it were a one-off situation but this user needs to be able to enter several at a time.

design – Use the type returned by a function as information

Over time I become used to use the type of the returned value of a function as a piece of additional information.

For example:
A function that is supposed to return or an array if the arguments are correct and can find a result, can pass a specific enum when arguments are incorrect or the expected result cannot be found.
Then I can test the type to sort the behaviour of the receiving code.

I can’t always use a typed function in the same way because the value that I reserve to explain what’s wrong removes a possible valid result.

I can see some other benefits and the main is that testing the type of the returned value is a very separated operation from the normal flow of the code and it seems more methodical to me.
Also, the segmentation now possible increases the flexibility of the code.
So, I’m quite sure that I write less code and, once one gets used, the code is readable.

  1. Is it acceptable?
  2. I’m going to work with an agency on some projects, can I ask if I can use this approach or is it against the best practices?