Show message when query has no posts

I wrote a shortcode to display all my jobs. When there are no jobs, I want to display a message instead of the available jobs. I used an else-statement to display different content if there are no posts, but nothing displays when I try it.

My code:

function dfib_jobs_shortcode( $  atts ) {     ob_start();      $  query = new WP_Query( array(         'post_type' => 'jobpost',         'posts_per_page' => -1,         'order' => 'ASC',         'orderby' => 'rand',     ) );       if ( $  query->have_posts() ) { ?>         <div class="vacatures__wrapper">             <?php while ( $  query->have_posts() ) : $  query->the_post(); ?>                 <div class="vacature__item">                     <h4 class="vacature__title"><?php the_title() ?></h4>                         <?php if ( has_excerpt() ) {                              the_excerpt();                         } else {                             the_content();                         } ?>                     <a class="vacature__btn" href="<?php the_permalink() ?>"><?php _e( 'meer info', 'vdp' ) ?></a>                 </div>             <?php endwhile; ?>             <div class="vacature__item spontaan">                 <h4 class="vacature__title"><?php _e( 'Spontaan solliciteren?', 'vdp' ) ?></h4>                     <a class="vacature__btn" href="<?php _e( '/spontaan-solliciteren', 'vdp' ) ?>"><?php _e( 'solliciteren', 'vdp' ) ?></a>             </div>             <?php wp_reset_postdata(); ?>         </div>      <?php $  myvariable = ob_get_clean();     return $  myvariable;     } else {         ?>         <div class="vacature__item spontaan">             <h4 class="vacature__title"><?php _e( 'Momenteel zijn er geen vacatures!', 'vdp' ) ?></h4>             <a class="vacature__btn" href="<?php _e( '/spontaan-solliciteren', 'vdp' ) ?>"><?php _e( 'Spontaan solliciteren', 'vdp' ) ?></a>         </div>         <?php     } } add_shortcode( 'vacatures', 'dfib_jobs_shortcode' ); 

Custom message logs

We could really use custom message logs, in 2 formats, failed and success, for example:

[STEP1]

custom failed1=Cannot register on this page
custom failed1 condition=You cannot register

custom success1=Already logged in
custom success1 condition=>Logout<

How might we help customers get back on track from a connection timeout message

I’m designing ‘sad path’ scenarios for checkout and I’m trying to design for helping customers when a connection timeout occurs when the checkout hangs trying to connect to our 3rd party credit card payment form.

When this happens the credit payment form could not get loaded in our checkout environment.

A simple solution is to reload the page.

The UX/UI solution I’m putting forward is an alert message that appears on the page and asks the customer to reload the page.

This is my attempt at making the error message more ‘user-friendly’:


A connection error occurred

An error occurred when we were trying to connect to the system.

Please reload the page to try connecting again.

[ Reload page ] <— button


How do people feel about the above message? Any other solutions you can think of?

Thanks.

Is it possible to analyze and decrypt personal message? [on hold]

Im working on my thesis to do some pentest on android application call Picmix. My research was test some vulnerability on this app if we using this on public WiFi. What im trying to do is test and analyzed some traffic or decrypt personal message without others devices knowing.

I use 2 smartphones with 2 my own account to do some personal message tests. It works fine for uploading and fetching image with driftnet on my kali.

This is for educational purpose only..

Contrast of a message box

I’m in the middle of updating the colours of our app and making them as consistent as possible, but also trying to bring them in line with the WCAG AA rating for contrast.

One area I’m unsure if I need to do this for, is an alert/info message that is displayed say at the top of a form to give users info about any warnings, or errors for example.

warning message

In this example, the text has an AA contrast of 7.09:1, however the yellow box itself is only 1.39:1 and therefore fails, however the containing box is not a component, or anything a user needs to directly interact with so do I actually need to worry about the contrast here? From a design perspective, I’d prefer a lighter colour (and on the other message types as well) but am just conscious of the contrast

Open message in modal or in separate page?

Unfortunately I can’t provide visual examples now, I hope that’s not a problem.

The question is simple: we have an inbox, which displays all the private messages a user has received, nothing new so far. When the user wants to open/read one of the messages, what should happen?

  • Open the message in a modal(if so, where should it be positioned? On the side of the screen, or in the middle of it? It only counts on desktop though)
  • Open it in a new page. Obviously for this we need to create a separate page for viewing single messages.

I also thought about maybe doing both, but I’m so not sure.

I know many say modal are a “no-go” in general, but let’s put that aside for now.

I’ve been thinking about it probably for days, but I can’t make up my mind, so I’d appreciate if you helped me out a bit.

In your experience, which one do you think would be a better way of doing it?

Fingerprint FTP services without Banner message

I want to write a python script that is able to fingerprint ports on a server to identify the FTP client running on the port.

While there is often a Banner message upon connection, this message is not reliable or can be removed easily.

Is there any tool / database etc available which can help to identify the different clients by behavior? e.g. by digging through source code i noticed that the PyFTPd Server uses the message “I’m going to ignore this command…” which can be used to identify that service.

I am happy for any help, as many FTP commands are supported and included in all daemons so it is difficult to find all the differences… I am trying to distinguish between

vsftpd pureftpd proftpd pyftpd