If there’s only one product with that title, then you can use the [content] shortcode by itself.
This will display the post content of the product post type, with the title:
[content type="product" title="High-speed access"]
Or other fields:
[content type="product" title="High-speed access" field="url"]
If there’s more than one product with the title “High-speed access”, I would suggest using a category, tag, taxonomy or another field to organize and display products.
—
Hmm, reading your question again, maybe I misunderstood. Please give more details, and I’ll see how I can help.
Hmm.. What it does basically is selecting all posts with custom field ‘product_category’ equals ‘internet’, but completely ignoring title=”High-speed access” part.
By title do you mean post title? If so, is there only only product with that title, or several?
There are several posts with the same title, but they are in different categories. That’s why I used loop
[loop type='product' category='panora' field_1='product_category' value_1='internet']
Maybe it will be easier if you had another custom field called speed, for high-speed access or not. Then you can search for it like this:
[loop type='product' category='panora' field='product_category' value='internet' field_2="speed" value_2="high-speed access"]
[content field="title"]
[content field="url"]
...
[/loop]
I think that’s probably not what you had in mind.
The reason why it’s not working as you want, is because when you specify [content title=”High-speed access”], it will find the first post with the title, regardless of the category, post type, etc.
The best way it seems is to use some parameter from the loop shortcode to search for the product you want to display.
Currently, there’s no parameter called title for the loop, but I could put it in there for the next update, so you could do something like:
[loop type='product' category='panora' field='product_category' value='internet' title="High-speed access"]
It seems like there should be an easier way.. Please let me know if you find a good solution.
OK, I’ll let you know when I get it implemented.
You know, I realized that you may be able to do this already. Please see the query here, the second field and value parameters.
[loop type='product' category='panora' field='product_category' value='internet' field_2="post_title" value_2="High-speed access"]
[content field="title"]
[content field="url"]
...
[/loop]
This should display content/fields from all products with category panora, product_category equals internet, and the title is: High-speed access.
Would that work for you?
Please see the update to version 0.4.4. I added the title parameter, so you can do something like:
[loop type='product' category='panora' title="High-speed access" field='product_category' value='internet']
[content field="title"]
[content field="url"]
...
[/loop]
Awesome! It works! Thank you!
The only thing is that title search seems to be case-sensitive (i.e. it doesn’t find any posts for ‘high-speed internet’ but does for ‘High-speed internet’)
Sure, I made it so it’s not case-sensitive. 🙂