Add prefix to page URL based on the page template
Add prefix to page URL based on the page template
Add prefix to page URL based on the page template
Database to page routing API?
I want to load content from another table into wp_posts and then show it as a normal page. What solution do you recommend. If that’s your goal, then use shortcodes! For example: // PHP code add_shortcode( ‘footag’, ‘wpdocs_footag_func’ ); function wpdocs_footag_func( $atts ) { return “foo = “.$atts[‘foo’]; } Then in your content: [footag foo=”bar”] … Read more
You can’t have both a page and a Custom Post type with the same slug, in your case videos. See: https://core.trac.wordpress.org/ticket/38599 for a ticket recommending this be changed in core. A few solutions: Change either the page or the post type to video instead of video Follow the Template Hierarchy and create a archive-videos.php with … Read more
WordPress web pages keep getting deleted (moved into the trash) by themselves
You could try merging the two arg arrays: $args = array( ‘post_type’ => array(‘post’,’page’), ‘tax_query’ => array( ‘relation’ => ‘OR’, array( ‘taxonomy’ => ‘category’, ‘field’ => ‘slug’, ‘terms’ => ‘slider’ ), array( ‘taxonomy’ => ‘my_taxonomy’, ‘field’ => ‘slug’, ‘terms’ => ‘slider’ ), ), );
Try the following at the top of your .htaccess file, before the existing WordPress directives: RewriteRule ^test/ /info/ [R=302,L] The pattern ^test/ matches all URLs that start /test/. Note that the URL-path matched by the RewriteRule pattern (first argument) does not start with a slash (when used in .htaccess). If this is intended to be … Read more
How to delete page by deactivating plugin
You can use this code once set page template for specific post. If the template isn’t set, you cant enqueue your script. if ( $post->_wp_page_template === ‘sky-template.php’ ) { wp_enqueue_script(); } Remember to replace sky-template.php with your template file name. Edit: You can get some help from this question. _wp_page_template to dynamically use template
Missing ‘Page Attributes’ in page edit