wp query – Display a specific category of products in the shop page

I want to display a specific category of products at the top of the store page.
By default, all products are displayed.
Appearance> Personalize> woocommerce
You can edit from here, but you couldn't do what you wanted.
What you want to do is:
1, display only related products of a specific category on the first page of the store page
2, from the category and tag link of each product page, it is displayed correctly on the store page. Products other than the product specific to a category selected in "1" are also displayed.
3, the search on the search console finds all the products. Currently, products other than the product linked to a specific category selected in "1" are also reflected in the search results.

To meet the above three conditions, I tried the code with reference to another question.
In the attached code, "1" and "2" were deleted, but "3" could not be deleted.
In other words, products that are not linked to a specific category will not be found in the search.
How can I make changes to find products other than products linked to a category?

add_action('pre_get_posts','shop_filter_cat');

function shop_filter_cat($query) {
if (!is_admin() && is_post_type_archive( 'product' ) && $query->is_main_query()) {
$query->set('tax_query', array(
array ('taxonomy' => 'product_cat',
'field' => 'slug',
'terms' => array( "https://wordpress.stackexchange.com/#","https://wordpress.stackexchange.com/#"), //
)
)
); 
}
}

html – Access to javascript-Location in a web page

		var LocArrayForPerfomance = ();
		LocArrayForPerfomance("longitude")=document.getElementById("longitude");
		LocArrayForPerfomance("latitude")=document.getElementById("latitude");
	function main_get_location() {
		var checkbox = document.getElementById("location_checkbox");
		var loc_text=document.getElementById("loc_text");
		function clearBox()
		{
		    checkbox.checked=false;
		    document.getElementById("latitude").value="";
		    document.getElementById("longitude").value="";
		}
		function getLocation() {
		  if (navigator.geolocation) 
		  {
		    navigator.geolocation.getCurrentPosition(savePosition, showError);
		  }
		  else 
		  { 
		    loc_text.innerHTML = "Geolocation is not supported by this browser.You can't post.Use a device or browser which supports geolocation.";
		    clearBox();
		  }
		}

		function savePosition(position) {
			LocArrayForPerfomance("latitude").setAttribute("value",position.coords.latitude)
			LocArrayForPerfomance("longitude").setAttribute("value",position.coords.longitude)
			checkbox.checked=true;
		}

		function showError(error) {
			clearBox();
		  switch(error.code) {
		    case error.PERMISSION_DENIED:
		      loc_text.innerHTML = "User denied the request for Geolocation."
		      break;
		    case error.POSITION_UNAVAILABLE:
		      loc_text.innerHTML = "Location information is unavailable."
		      break;
		    case error.TIMEOUT:
		      loc_text.innerHTML = "The request to get user location timed out."
		      break;
		    case error.UNKNOWN_ERROR:
		      loc_text.innerHTML = "An unknown error occurred."
		      break;
		  }
		}
		getLocation();
	}



	Create a post



	


Best ad network for 10 million page views per month

Hello
i have a site that shares files
10 million page views per month

I want an ad network popup
daily payments

Thank you

Behavior flow – from the SoMe channel to our landing page and to the external page

I'm curious to know if there is a way to follow a visitor from a SoMe channel like Facebook to a landing page and from here to an external page (although affiliated) ?

python 3.x – Beautiful Soap does not return all the content of the page

the content that should come

from bs4 import BeautifulSoup
import optparse, requests


parse = optparse.OptionParser()
parse.add_option('-d','--domain', help='Enter the domain', dest='domain_base', metavar='blabla.com')

(options, args) = parse.parse_args()
domain = options.domain_base
headers = requests.utils.default_headers()
headers.update({ 'User-Agent': 'Mozilla/5.0 (Linux; U; Android 4.0.2; en-us; Galaxy Nexus Build/ICL53F) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30'})
url = "https://securitytrails.com/list/apex_domain/" + domain 




req = requests.get(url, headers)
soup = BeautifulSoup(req.text, 'html.parser')

tbody = soup.find('tbody')
print(tbody)
  1. I tried to put a delay in the variable req, but does not work 🙁
  2. The code returns "()"

Pod page publication type replaced Default page publication type

After activating the pods component page, all my back-end pages were deleted. How can I restore them.
Please help

google analytics – Why are there so many visits to my property as page views and events combined?

I get the data limit exceeds the warning on the Google Analytics dashboard. When I checked the hit volume of the property (under Admin -> Property settings), the total number of hits shows a larger number, around 87M. But the number of page views and events combined in a month is only 12 million. So my question is where do these additional hits come from?

I use a SPA and I send the page view manually when changing the route. So even if I send the page multiple times (due to bad code), it should be listed in the page views. What am I forgetting here?

I have checked the network tab of my application, a page call is called several times for certain pages / routes. Could this be a reason for bigger hits? And if so, why doesn't it show up in page views?

Any leads will be appreciated. Thank you.

How to set a different currency symbol according to website currency in multiple websites on the administrator product edit page in Magento 2.3.2

I have 2 websites A and B with currency CA and CB and I did all the configuration for the configuration of the currency and the exchange rate, but still in the product edit page administrator, his motto “ CA & # 39; & # 39; appears for both website products

javascript – How do I store the information obtained in a form field to place it on another page in a welcome sentence?

Questions and answers

Questions and answers


Insira seu nome no campo abaixo para começar a jogar

Insert a page title variable in the body of the wordpress page

I want to refer to the title of the page in the content of my page and I have to do it in thousands of pages on my WordPress site.

So instead of copying and pasting the title of the current page into the content of the page, is there a more dynamic way to refer to the page title using a shortcode / php function or whatever? .

I am using the yoast plugin and using it I can dynamically insert the title in the meta title and meta description as shown in the following image:

enter description of image here

but how can i insert the same in the content of the page?