php – How to add Text before my Custom Term and hide it when empty

This is my code:

    <?php
    $terms = get_the_terms( $post->ID , 'this_is_custom' );
    $links = ();
    foreach ( $terms as $term ) {
        $term_link = get_term_link( $term, 'this_is_custom' );
        if( !is_wp_error( $term_link ) ) {
            $links() = '<a href="' . $term_link . '">' . $term->name . '</a>';
        }
    }
    echo implode(',&nbsp;', $links);
    ?>

The result are:

Mango, Orange, Banana

What it wants to achieve is:

Tag: Mango, Orange, Banana

How can I display the word “Tag: ” and hide it when there is no Term inside current post?

Sorry for my English. I hope you understand.
Thanks for your answer, I really appreciated.

css – Sticky Menu with Hide the sticky menu on scroll down

I am trying to add a sticky menu on my webpage. The sticky menu has to go away if I scroll down and It has to appear when I scroll up. I have gone over the internet and found some answers. But it is not working as expected. I tried 2 cases.

Case 1:
I tried below CSS and JS:

CSS:

@media (min-width: 769px) {
    .main-navigation {
        position: sticky;
        top: 0px;
        z-index: 99;
    }
}

JS:

jQuery(document).ready(function( $ ){
  var previousScroll = 0;
  $(window).scroll(function(){
       var currentScroll = $(this).scrollTop();
       
       if (currentScroll >= previousScroll){
           $('#primary-menu').addClass('menu-toggle');
       } else {
           $('#primary-menu').removeClass('menu-toggle');
       }
       previousScroll = currentScroll;
    });
  
});

When I try the above code, it is working well but sometimes the sticky menu is flickering like a flashlight.

Then I tried the next case.

Case 2:

CSS:

@media (min-width: 769px) {
    .main-navigation {
        position: fixed;
        top: 0px;
        width:100%;
        z-index: 99;
    }
}

JS:

jQuery(document).ready(function( $ ){
  var previousScroll = 0;
  $(window).scroll(function(){
       var currentScroll = $(this).scrollTop();
       
       if (currentScroll >= previousScroll){
           $('#primary-menu').addClass('menu-toggle');
       } else {
           $('#primary-menu').removeClass('menu-toggle');
       }
       previousScroll = currentScroll;
    });
  
});

In this case, it is not flickering. But it is overlapping with the header. Please look at the image here.

Actually, the menu has to come after the header. Can anyone help me to solve this?

shaders – How to hide player when in Shadow using Unity 2D Light System?

I have been looking for this for a couple of days now and cant find an answer; how can I hide a player when they are in the shadow when am using Unity 2D Light System? I know I can choose not to cast light on objects, but when I do it still shows the object in the shadow. What am looking for is hiding the player completely when they are in shadow, and when the light hits them it would reveal the player. This effect is in the game Among Us, I know that they are using some sort of shaders and they didn’t have 2D light when they were developing it.

So am assuming this would be a shader as well where it would reveal the player when they are in the light and hide them when they are in the shadow. Below are pictures of what I have and what I want it to look like.

This is what I have in Unity
Among Us In Unity With 2D Light

So you can see that the player is not hidden in the shadows, but rather its blacked out.

But this is what am looking to recreate:
enter image description here

You see how the top half of the body which is in the shadow is hidden while the bottom half is revealed because its in the light? This is the effect that I want to recreate.

Is there some sort of Shader or code that can do this? I really been looking for something like this for so long and couldn’t find it. Any help will be really appreciated.

forms – What is the best way to hide a Honeypot Captcha?

I hide the honeypot field using some positioning/clipping as I suspect display: none is a clue to a spambot to avoid the field. At the least, it’s a possibility.

However, I appreciate it seems a lot for a bot to parse the HTML class and find the property value pair in the CSS itself. I wonder if class names such as hide alert the spammer? That would be a lot easier to figure out.

Ideally, we’d make the form as usable and easy as possible and deal with any spam that generates away from the user. The problem here can be financial, especially if you’re running a static/headless site, as most form services charge for the number of submissions you generate. For example, Netlify will give you 100 submissions a month for free, but then they’ll charge.

My anecdotal evidence was that more spam appeared to get through my Netlify forms when I was using display: none. Of course, Netlify’s own spam filter may have improved, so I can’t be sure the clipping/positioning approach made a difference.

If you are hiding the form rather than blitzing it a screen reader will still announce it. This is one of the few occasions where display: none makes something more usable as it means one less field to interpret and navigate for a screen reader. However, I don’t think it’s right to say not using display: none is inaccessible; as long as the honey pot field has a label that makes it obvious the field should be left empty, it’s accessible.

I guess there’s also the possibility that spam bots scan the label text to identify honey pot fields. This poses another problem – how do you avoid words like robot and spam in the field label?

Is it ok to hide the full settings until initial onboarding steps are complete?

Making the settings available only after having completed an onboarding does not seem a good solution. You are afraid that users will be lost when confronted with these settings. But to force the user to complete an onboarding seems quite patronizing.

It always should be in the users choice how to proceed.

Onboarding is not always a good solution either. It might be better (maybe in addition) tho provide guidance where it is needed (interesting article on onboarding https://www.nngroup.com/articles/mobile-app-onboarding/ )

So what I would suggest, is an approach that hides the additional settings for example in an expander, something like “pro mode”. On showing them give the user specific guidance per setting or if necessary for a group of settings.

If you do an onboarding keep in mind that a user has to remember all the information given in the onboarding.

sharepoint online – Hide / Show column based on another column choice

As you have mentioned, You need to show the Computer Issue if the Computer is selected, but the above code will show it only if it was not equal to != Computer.

So, you just need to swap it from show to hide if it’s not equal to Computer as below

<script type="text/javascript">
$(document).ready(function(){
   $('nobr:contains("Computer Issue")').closest('tr').hide();  
    //Show/hide columns based on Drop Down Selection 
   $("select(title='Subject')").change(function() {
 if ($("select(title='Subject')").val() != "Computer") 
   {
     $('nobr:contains("Computer Issue")').closest('tr').hide();
   } 
 else 
   {
     $('nobr:contains("Computer Issue")').closest('tr').show();
   }
   });
});
</script>

or, just change != to == as below

<script type="text/javascript">
    $(document).ready(function(){
       $('nobr:contains("Computer Issue")').closest('tr').hide();  
        //Show/hide columns based on Drop Down Selection 
       $("select(title='Subject')").change(function() {
     if ($("select(title='Subject')").val() == "Computer") 
       {
         $('nobr:contains("Computer Issue")').closest('tr').show();
       } 
     else 
       {
         $('nobr:contains("Computer Issue")').closest('tr').hide();
       }
       });
    });
    </script>

Read also

spfx – What is the quickest way to hide SharePoint Elements on a Modern page?

I have a SharePoint modern site homepage which I am using as a landing page. Currently I am hiding the default elements in site like “Site Title” and “Logo” using custom CSS which is loaded with the extension.

But the problem is, whenever the page loads, the elements show for a little while and then hide when the CSS is loaded which is kind of ugly for a landing page. I am looking for ways to hide the elements as quickly as possible.

Currently Microsoft doesn’t provide a solution to this so this has to be a custom solution.

How to hide description on categories and tags?

Does anybody know how I can hide the descriptions from view for the categories and tags for my website? I have searched for a while but can’t find any solutions. I would like it so that when they are clicked it just shows the categories or posts available, no description visible. Can someone show me how to do this please?

https://lawlessons.co.uk/ (when hovering the mouse over the category it brings up a description).

https://lawlessons.co.uk/tag/contract-law-agreement-offer-and-acceptance (when opening a category it shows a description).

https://lawlessons.co.uk/category/contract-law/agreement-offer-and-acceptance (when opening a tag it shows a description).

(Author wordpress theme).

Happy new year!

woocommerce offtopic – Hide Add to cart and display secondary button on that place

i have added second button after “Add to cart” for “Ask for more info” and it works just fine. Unfortunately I have problem with products which don’t have “Add to cart” and i need to display just “Ask for more info”. I tried with woocommerce_after_add_to_cart_button and woocommerce_after_add_to_cart_form hooks but when “Add to cart” is hidden i don’t see my second button.

Is there any way to hide “add to cart” to not affect my second button?

Is it bad for SEO to use CSS to hide the H1 tag for mobile visitors?

The standard practice for showing h1 tags on large resolution screens (PC) while hiding h1 tags for mobile devices is to use CSS in a way similar to as follows:

<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<style>
@media screen and (max-width: 850px) {   
h1 { font-size: 12px;
}
@media screen and (min-width: 850px) {   
h1 { font-size: 24px;
}
</style>

This allows you to put page keywords in h1 tags which still may be relevant to keyword targeting in search engines, while also limiting the size of the text when displayed on various screen sizes.

It’s also considered fine SEO practice to display certain content to PC users that is not visible to mobile users and vice versa. So hiding the h1 tags is a potentially fine method, though you might prefer to change the font sizing instead as suggested with my method.

It’s unlikely that you would get hit with a penalty for “hiding text” with display:none, though you never know. Websites used to stuff keywords in their pages with display:none and were penalized for it as a result. Googlebot should understand that you are simply trying to show this content to PC users but not to mobile users, but it’s possible for the bot to misinterpret your intentions. As a result, I believe it’s preferable to change the font-size when applicable instead of simply hiding the entire block of content.