我创建了新的自定义帖子类型-在wordpress中进行交易,并在发布新交易帖子后将其重定向到edit.php(帖子列表)。因此,我想将其重定向到交易列表页面(http://mydemo.com/demo/edit.php?post_type=deals),所以请帮助我。
我尝试了这段代码,但是它将所有帖子类型重定向到指定页面。
add_filter( 'redirect_post_location', 'wpse_124132_redirect_post_location' );
/**
* Redirect to the edit.php on post save or publish.
*/
function wpse_124132_redirect_post_location( $location ) {
if ( isset( $_POST['save'] ) || isset( $_POST['publish'] ) )
return admin_url( "edit.php?post_type=deals" );
return $location;
}
Run Code Online (Sandbox Code Playgroud) 我已经创建了精明的联系表单捆绑包,它工作正常,但我想使用knp-pagination捆绑包显示所有联系表数据,但它不起作用所以请帮我解决这个问题.
我收到了这个错误
FileLoaderLoadException: Cannot import resource "C:\wamp\www\Acme\app/config\config.yml" from "C:\wamp\www\Acme\app/config/config_dev.yml". (There is no extension able to load the configuration for "knp_paginator" (in C:\wamp\www\Acme\app/config\config.yml). Looked for namespace "knp_paginator", found "framework", "security", "twig", "monolog", "swiftmailer", "assetic", "doctrine", "sensio_framework_extra", "savvy_contact", "web_profiler", "sensio_distribution")
Run Code Online (Sandbox Code Playgroud)
*这是我的config.yml*
imports:
- { resource: parameters.yml }
- { resource: security.yml }
framework:
#esi: ~
translator: { fallback: "%locale%" }
secret: "%secret%"
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: ~
form: ~
csrf_protection: ~
validation: { enable_annotations: true }
templating:
engines: ['twig']
#assets_version: …Run Code Online (Sandbox Code Playgroud)