Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class CFunctions
- {
- public function __construct ()
- {
- add_action('init', [$this, 'rewrite_rule_cpost']);
- }
- public function rewrite_rule_cpost()
- {
- $post_type = 'avada_portfolio';
- add_rewrite_tag( "%avada_portfolio%", '([^/]+)', "post_type=$post_type&name=" );
- $permastruct = "nefteprodukty/%avada_portfolio%"; // наша структура ЧПУ
- $args = array(
- 'with_front' => true,
- 'paged' => true,
- 'ep_mask' => EP_NONE,
- 'feed' => false,
- 'forcomments' => false,
- 'walk_dirs' => false,
- 'endpoints' => false,
- );
- add_permastruct( $post_type, $permastruct, $args );
- }
- }
- new CFunctions();
Add Comment
Please, Sign In to add comment