Setting fallback (default) image to featured image block

I was trying to make a block based theme and encountered a problem trying to set a default featured image in case some posts do not have them.

Basically, we used to do this in php

<?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } else { ?> <img src="<?php bloginfo('template_directory'); ?>/images/default-image.jpg" alt="<?php the_title(); ?>" /> <?php } ?> 

But now with blocks, themes are html and all I can see is

<!-- wp:post-featured-image {"isLink":true} /--> 

I couldn’t find any other parameters here nor an if/else block so I could just add a plain html.

If anyone has done this, that would be of great help.

Thanks.

How can I add transparent color option in my color setting?

I have created font color settings at customizer but it does not include transparent color, How can I add transparent option also.

enter code here 

class site_font_color { public static function register ( $ wp_customize ) {

    $  wp_customize->add_setting('site_emakers_fontcolor', array(         'default' => 'No'     ));      $  wp_customize->add_control(new WP_Customize_Control($  wp_customize, 'site_emakers_fontcolor-control', array(         'label' => 'Display the Site Font Color?',         'section' => 'colors',         'settings' => 'site_emakers_fontcolor',         'type' => 'select',         'choices' => array('No'=> 'No', 'Yes' => 'Yes')     )));        $  wp_customize->add_setting( 'site_emakers_fontcolor',         array(             'default'    => '#000000',             'type'       => 'theme_mod',             'capability' => 'edit_theme_options',             'transport'  => 'refresh',             'priority'   => 120,             'sanitize_callback'  => 'esc_attr',         )     );      $  wp_customize->add_control( new WP_Customize_Color_Control(         $  wp_customize,         'mytheme_site_emakers_fontcolor',         array(             'label'      => __( 'Site Font Color', 'customtheme' ),             'settings'   => 'site_emakers_fontcolor',             'priority'   => 10,             'section'    => 'colors',         )     ) );  }   public static function site_output() {     ?>      <style type="text/css">          <?php self::generate_css('.site *, :not(.btn-secondary, .btn)',  'color', 'site_emakers_fontcolor'); ?>     </style>      <?php }   public static function generate_css( $  selector, $  style, $  mod_name, $  prefix='', $  postfix='', $  echo=true ) {     $  return = '';     $  mod = get_theme_mod($  mod_name);     if ( ! empty( $  mod ) ) {         $  return = sprintf('%s { %s:%s; }',             $  selector,             $  style,             $  prefix.$  mod.$  postfix         );         if ( $  echo ) {             echo $  return;         }     }     return $  return; } 

}

add_action( ‘customize_register’ , array( ‘site_font_color’ , ‘register’ ) );

add_action( ‘wp_head’ , array( ‘site_font_color’ , ‘site_output’ ) );

I used bool parameter in my animator controller setting it to true by script but where should I set it back to false and when?

using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.UI;  public class FireEffect : MonoBehaviour {     public Transform player;     public Transform target;      private float timeElapsed = 0;     private float lerpDuration = 3;     private float startValue = 1;     private float endValue = 0;     private float valueToLerp = 0;      private Animator playerAnimator;     private bool prevFacing = false;     private bool stopped = false;     private bool move = true;     private bool rot = false;     private Vector3 currPos;      private void Start()     {         playerAnimator = player.GetComponent<Animator>();     }      private void Update()     {         var currFacing = IsFacing(target);         if (currFacing != prevFacing)         {             timeElapsed = 0;         }         prevFacing = currFacing;          var distance = Vector3.Distance(player.position, target.position);          if (IsFacing(target))         {             if (distance < 10 && move)             {                 if (timeElapsed < lerpDuration)                 {                     valueToLerp = Mathf.Lerp(startValue, endValue, timeElapsed / lerpDuration);                     playerAnimator.SetFloat("Forward", valueToLerp);                     timeElapsed += Time.deltaTime;                 }                 playerAnimator.SetFloat("Forward", valueToLerp);                 stopped = true;                 valueToLerp = 0;             }              if (move == false)             {                 playerAnimator.SetFloat("Forward", 0);             }              if (playerAnimator.GetFloat("Forward") == 0 && stopped)             {                 move = false;                 rot = true;                 currPos = player.position;                 stopped = false;                 Debug.Log("Player current position when valueToLerp value is 0 : " + currPos);             }         }                  if(rot)         {             playerAnimator.SetBool("Walk Back", true);              rot = false;         }          if (playerAnimator.GetCurrentAnimatorStateInfo(0).IsName("Walk Back"))         {             playerAnimator.SetBool("Walk Back", false);         }     }      private bool IsFacing(Transform target)     {         Vector3 forward = player.TransformDirection(Vector3.forward);         Vector3 toTarget = target.position - player.position;         return Vector3.Dot(forward, toTarget) > 0;     }      public IEnumerator ScaleOverSeconds(Vector3 scaleTo, Vector3 rotateTo, Vector3 moveTo, float seconds)     {         float elapsedTime = 0;         Vector3 startingScale = player.localScale;         Vector3 startingRotation = player.localEulerAngles;         Vector3 startingPosition = player.localPosition;          while (elapsedTime < seconds)         {             player.localScale = Vector3.Lerp(startingScale, scaleTo, (elapsedTime / seconds));             player.localEulerAngles = Vector3.Lerp(startingRotation, rotateTo, (elapsedTime / seconds));             player.localPosition = Vector3.Lerp(startingPosition, moveTo, (elapsedTime / seconds));              elapsedTime += Time.deltaTime;              yield return null;         }         player.localScale = scaleTo;         player.localEulerAngles = rotateTo;         player.localPosition = moveTo;     } } 

At this part, I’m setting the bool to true once and it’s playing the "Walk Back".

if(rot)             {                 playerAnimator.SetBool("Walk Back", true);                      rot = false;             }                  if (playerAnimator.GetCurrentAnimatorStateInfo(0).IsName("Walk Back"))             {                 playerAnimator.SetBool("Walk Back", false);             } 

After that, I’m setting the trigger to false when it’s finishing playing it because if I will not set it to false it will keep playing the "Walk Back" nonstop.

I want that it will play it once but also when rot is true again then play it again once. but because I’m setting it false it’s not playing it again even if rot is true again.

animator controller

I created a transition from the Grounded blend tree to the Walk Back with the bool condition in the screenshot.

The Walk Back is working fine smooth as I wanted the problem is now how to make it play once only each time rot is true?

The way or the place in the script I’m setting the bool back to false make it that it will not play the Move Back ever again even if rot is true.

Guidelines for setting haggle test difficulty when using the tracking money option?

I have been running a game of WFRP 4e and my players haven’t really been enjoying tracking money much so I was thinking of switching to the optional tracking money rule on page 290 of the rule book.

Where some groups like to track every penny closely, perhaps even using chits or fantasy coins to represent in-game coins, others prefer to ignore all fiscal book-keeping. The game rules assume you are counting every coin, but if you wish to simplify money, you can do so using your Status. If an item costs less than your Status level — so if you have a Status of Silver 2, any item costing 2 silver shillings or less — you are assumed to be able to buy as much as needed of that item. Beyond that, you can buy a maximum of one item a day that costs more with a Haggle Test, with the difficulty set by the GM according to the cost of the item and the local markets.

My problem is that according to the rules only a gold tier character can reasonably afford a main gauche let alone other weapons so my players will need to make haggling tests however I couldn’t find a guideline for haggle tests when using this system.(And the regular haggle rules woul not be appropriate on the grounds that the most you can negotiate is a %50 off) So what I wish to ask is Are there any guidelines somewhere for setting haggle difficulty and if not what are the rules you use on your table?

AWS Postgres setting pg_trgm.word_similarity_threshold

Trying to set pg_trgm.word_similarity_threshold on an RDS postgres instance (postgres 12 if it matters):

ALTER SYSTEM SET pg_trgm.word_similarity_threshold = 0.3; 

I get the error: must be superuser to execute ALTER SYSTEM command

I don’t see this in the parameter groups even though pg_trgm is a supported extension. Is there something I’m missing?