Folder wordpress page redirect
Finally found the way after a lot of testing: RewriteRule ^terms /blog/index.php/termspage [NC,L]
Finally found the way after a lot of testing: RewriteRule ^terms /blog/index.php/termspage [NC,L]
I think it could be a problem with get_comments_number which returns numeric, though theoretically it should test this way too… you could try instead: if ( comments_open() || have_comments() ) : comments_template(); endif; OR if ( comments_open() || (get_comments_number() > 0) ) : comments_template(); endif;
Solved I’ve solved the problem and I’m going to share the code I used, so other developers that have this issue too can cope with it. The get_pages()-function accepts the “hierarchical” argument. By default it’s set to 1 (true), which means, that WordPress searches the pages in hierarchical order to find the other parameters. If … Read more
In a theme with no menu locations defined – or a WordPress install with no menus set up – the default fallback option for menus is to display the output of wp_page_menu(). By default, this will output all of your pages firstly by their order, then by their title if the orders match. This makes … Read more
Use wp_list_pluck to extract an array of IDs from your query, then pass those to is_page. $top_level_ids = wp_list_pluck( $top_level_pages, ‘ID’ ); if ( is_page( $top_level_ids ) ) { // do something }
get_permalink will fetch the URL of the current post within a loop. If you call it on an archive page, then what WP thinks is the “current post” is actually the first post that you are about to loop through and so you end up with that post’s permalink rather than the current page’s URL. … Read more
The ID of the current page is available via the global $post variable, so to get the ID use: global $post; $currentPage = $post->ID; Then you can use $currentPage in your query 🙂
Test you the following filter work for you: function wpse245094_fist_duplicate_slug( $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ) { // slug had to change, we must have a duplicate if ( $original_slug !== $slug ) { // try to replace `-2` with `-es` $new_slug = preg_replace( ‘#-2$#’, ‘-es’, $slug ); if ( $new_slug !== $slug ) … Read more
Thank you @WebElaine for the tips about using a child theme. I found the code that put the Home link first. The file was located in /wp-content/themes/vantage/inc and file extras.php function vantage_page_menu_args( $args ) { $args[‘show_home’] = false; return $args; } Had to change $args[‘show_home’] = false; to false.
This will work only if your template is in the root folder, if its in a subdirectory you need to supply that too: if ( is_page_template( ‘template_folder_name/custpage.php’ ) ) { wp_enqueue_style( ‘vega’, get_stylesheet_directory_uri() . ‘/style2.css’ ); }