wp query: what code to use in an array to call the current subcategory?

This function lists only the products for the subcategory called: bags:

$args = array( 'post_type' => 'product', 'product_cat' => 'bags')
$loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post();

If I run this code on a category page, how can I change the & # 39; bags & # 39; coded to dynamically produce products from the active subcategory of the category page?

Blockchain fork: Given the current situation, which currently available Bitcoin customers are more likely to follow the longest chain within a month?

Battery exchange network

The Stack Exchange network consists of 175 question and answer communities, including Stack Overflow, the largest and most reliable online community for developers to learn, share their knowledge and develop their careers.

Visit Stack Exchange

macos – Why does `ps -e` show information about the processes of the current user?

I am currently at macOS Catalina:

nlykkei:~/projects$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.15.2
BuildVersion:   19C57

I wonder why -e (identical to -A) option of ps shows information about my current user's processes, when only -a the option mentions:

Show information about the processes of other users just like yours.

 -A      Display information about other users' processes, including those without controlling terminals.

 -a      Display information about other users' processes as well as your own.  This will skip any processes which do not have a controlling terminal, unless the -x option is also specified.


 -e      Identical to -A.

Any ideas?

enter the description of the image here

Excerpt from articles on the Relia Theme home page shows the excerpt from the current page, not the publications that are extracted

Help! I spent many hours on this: using the Relia theme, for the articles on the home page, the excerpt shows the excerpt from the current page for the three articles, not the excerpts from the respective articles (also known as "publications").

Functions – Move to trash type of personalized publication after the date of the ACF date picker is earlier than the current

I have a type of personalized publication called & # 39; aktualitates & # 39; and I have a date picker field in the publications of the Advanced Custom Fields snap-in with the field name & # 39; aktuali_expire & # 39 ;. I tried adding a code from another question to functions.php, but it doesn't seem to work for me. I am sure that the time values ​​are set to Y / m / d in this code and in the ACF field configuration.

I also tried to configure the action as scheduled, as shown in the code of this question, but after hours it did not seem to be activated.

add_action( 'init', 'delete_expired_events' );

function delete_expired_events() 

$args = (
    'post_type'      => 'aktualitates',
    'posts_per_page' => -1,
    'fields'         => 'ids', //only get post id's
    'meta_query'     => (
           'key'     => 'aktuali_expire',
           'value'   => current_time( 'Y/m/d' ),
           'compare' => '<'

$aktualitates = get_posts( $args );

if ( $aktualitates ) {
    // Loop through the post ID's and delete the post
    foreach ( $aktualitates as $id )
        wp_trash_post( $id );

Any help would be appreciated!

javascript – React Hooks: use of the current state Effect without relying on it

I have encountered a situation in React where I want to execute a function F on a useEffect hook whenever a value V1 of the store changes. F use another store value V2. I just wanna run F when V1 changes, but to access the last value of V2. This means that I would not like to include V2 in the list of dependencies for useEffect.

Below is my current solution, but I wonder if there is a more accepted way to achieve this.

const v1 = useSelector(state => state.v1);
const v2 = useSelector(state => state.v2);

const v2_ref = useRef(v2);
useEffect(() => {v2_ref.current = v2}, (v2));

useEffect(() => {
  v1 ? doSomething(v2_ref.current) : doSomethingElse();
}, (v1));

enterprise sharepoint: get task data from the current item using InfoPath

I have been struggling to find a solution, but I hope you can help me.
I have a Sharepoint list with the following fields:

ID (generated automatically) 
PLANT (dropdown with the data: LMS, LMA and SAN)
FIELD3 ... etc

Users add a new item to this list and then start a workflow. So far so good.
The data in this list will be something like this:

1, LMS
2, LMA
3, LMS
4, LMA
5, LMA

The problem is that I want to get the data from the "Plant" field of this specific item task and display it in the InfoPath form. What happens when I try to use the secondary data shows all "Plant" of all items on the list:

enter the description of the image here

I was supposed to show only one result because I want it from Current item list.

django – How can I compare the TimeField model with the current time?

Thank you for contributing a response to Stack Overflow!

  • Please make sure answer the question. Provide details and share your research!

But avoid

  • Ask for help, clarifications or respond to other answers.
  • Make statements based on opinion; Support them with references or personal experience.

For more information, see our tips on how to write excellent answers.

Automation: how to automate the sending of my current battery percentage to the PC over the Internet every 5 minutes?

I've done a not so elegant to do this but anyone who can to get better about this or give a best The solution should do it.

I'm using gist by Github for transmitting my battery percentage first to a private file, I tried to use ix.io what I usually use but pkg install ix It did not work on the Android terminal config.guess threw and error saying unable to guess system type Anyone who does that should try to edit that file and set default values ​​on it.

Already had Termux installed on my Android with the necessary packages and with pkg install termux-battery-status and install the api Playstore application: https://play.google.com/store/apps/details?id=com.termux.api&hl=en_IN using termux-battery-status | grep percentage | grep -oP ': (.*?),' | grep -Eo '(0-9){1,3}' gave the percentage of battery in the terminal.

I finally set crontab on Android to do this every 5 minutes with a switch to activate and deactivate the script when it is not necessary, see https://github.com/termux/termux-app/issues/1091

PS: I'll put the full script here when I get the cronjob To work perfectly: https://github.com/himanshuxd/bp-broadcast

Automation: is there a way to send only two digits (my current battery) from Android to my PC over the Internet every N minutes?

I'm using Android 9 In Myself Xiaomi Redmi Note 7 Pro and on PC use Windows 10 Y Arch Linux, there are many times when I am away from my phone and it is charging in a different room or someone else is using it, was there any way to send more than two digits? bp) to my PC at regular intervals over the Internet.

There may be applications that can do this (those answers are welcome), but I'm more interested in a script-based approach, do I have to root my phone to do it or will I? sh command.sh job.

The ideas I'm thinking are:

I have Termux installed and my device is not rooted yet, how do I proceed?