How to redirect a page to subdomain?
Can you use a custom menu (Appearance -> Menus) ? If so, just create a custom link and insert it where desired. This has the added benefit of not cluttering your list of pages with a page that isn’t real.
Can you use a custom menu (Appearance -> Menus) ? If so, just create a custom link and insert it where desired. This has the added benefit of not cluttering your list of pages with a page that isn’t real.
ok, found the answer here : http://codex.wordpress.org/Function_Reference/wp_list_pages#Exclude_Pages_from_List here is the core of the answer : Markup and styling of page items By default, wp_list_pages() generates a nested, unordered list of WordPress Pages created with the Write > Page admin panel. You can remove the outermost item (li.pagenav) and list (ul) by setting the title_li parameter … Read more
To dynamically add menu items you can use WP_Query, specifically get_posts or get_pages. Get pages is more consistent. Here’s an example to add all pages to the Pages admin menu. You can change paramaters to exclude, include, orderby, etc in the $args below. To change to a custom post type just change $custom variable to … Read more
Try this: if ( is_front_page() && is_home() ) { // Default homepage } elseif ( is_front_page() ) { // static homepage } elseif ( is_home() ) { // blog page } else { //everything else } Source: http://codex.wordpress.org/Conditional_Tags
Even if you will keep your content static, you must create the pages through wp-admin. It’s the right and easiest way. After that, you have some options of how you will keep your content static: Page template You’ll create a file into your theme folder with your static content, starting with this piece of code … Read more
No script of function necessary. It’s actually built into WordPress. Simply go to your page to edit and on the right hand side you should see a widget labeled Publish. On the third line down, you will see an Edit button and you can set the date and time on when you want the page … Read more
querySelector() returns null if no matches are found, so wrap the code that depends on imagineVideo in a conditional statement. var imagineVideo = document.querySelector(‘.page-id-36 .et_pb_video_box video’); if ( imagineVideo ) { imagineVideo.play(); imagineVideo.loop = true; imagineVideo.controls = false; } If you only want this code to be loaded on the homepage, you can put it … Read more
The following conditions is assumed to make it working Classic Editor is in use, since Gutenberg/Block Editor is rendered by Javascript, it requires another solutions and so far I am not sure if there is override option yet. For the code you have shown, it does not work because the number of arguments for add_filter() … Read more
The modern way would be to use html5 which does support geolocation: simple demo A bit longer explanation how this could be added to a web-app here A nice php script that uses a web service called geoplugin (the api is nice, no idea about the company, ymmv!) And last but not least, using the … Read more
Rather than call WP_Query() you can use get_post() and “set up” the global $post. This is probably a little more efficient than @tf’s answer, though the ideas are broadly the same. Please note, in both cases you should reset the post data afterwards. /** * Display the post content. Optionally allows post ID to be … Read more