简体   繁体   English

通过WP中的自定义查询将一个Portfolio Gallery URL链接到另一个

[英]Link one Portfolio Gallery URL to another by way of Custom Query in WP

I would like to link a Visual Portfolio Gallery to another gallery filter by way of querying particular custom post types. 我想通过查询特定的自定义帖子类型将Visual Portfolio Gallery链接到另一个图库过滤器。 I have already tried custom queries in the lines of post_type="post, cubeportfolio" since I will be referencing all posts from the cubeportfolio gallery plugin with post type slug "cubeportfolio". 我已经在post_type="post, cubeportfolio"的行中尝试过自定义查询,因为我将引用来自cubportfolio画廊插件的所有帖子,帖子类型为“ cubeportfolio”。

This method seems to work with other custom posts but not posts from the cubeportfolio gallery. 此方法似乎适用于其他自定义帖子,但不适用于cubeportfolio画廊中的帖子。 The Portfolio Gallery i am trying to link is embedded in this page here http://tile.johnzuh.com/ . 我尝试链接的Portfolio Gallery嵌入在此页面http://tile.johnzuh.com/中 Link to plugin website https://wordpress.org/plugins/visual-portfolio/ for reference purposes. 链接到插件网站https://wordpress.org/plugins/visual-portfolio/以供参考。

I might just need some tips on how to query filters from another plugin in wordpress or simply just link the URL of the filters directly to the visual portfolio i am using so when user clicks on them it takes them directly to a particular category and its respective gallery. 我可能只需要一些有关如何从wordpress中的另一个插件查询过滤器的提示,或者只是将过滤器的URL直接链接到我正在使用的可视化产品组合,因此当用户单击它们时,它们会将它们直接带到特定类别及其各自的类别。画廊。

I don't have Cube Portfolio as it's a paid plugin, but I did download Visual Portfolio to check it out. 我没有Cube Portfolio,因为它是一个付费插件,但是我确实下载了Visual Portfolio以进行检查。 Have you considered trying to filter things via the post category instead? 您是否考虑过尝试通过帖子类别过滤内容?

This way you wouldn't have to do any registering of custom post types in your functions.php file ( see here ). 这样,您就不必在functions.php文件中进行任何自定义帖子类型的注册( 请参见此处 )。 You could add categories to your items and reference them using the code below. 您可以在商品中添加类别,并使用以下代码引用它们。

is_category('Category A')

You could obviously use a combination of both post_type and is_category in your query to get the desired result. 您显然可以在查询中同时使用post_type和is_category来获得所需的结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM