How to change static page to static post in sub domain setting.
-
How can i show single post in sub domain homepage.
just like page selecting from sub domain setting like
Setting >> Subdomain Setting >> Customize >> “A static page >> Front page:”I have changed to :
$r = isset($this->selected_categories[$this->id_subdomain]['front_page']) ? $this->selected_categories[$this->id_subdomain]['front_page'] : ''; $posts = get_posts( array( 'post_type' => $post_type, 'numberposts' => -1, 'category' => $this->id_subdomain ) ); if( ! $posts ) return; $out = '<select id="mcs_categories[front_page]" name ="mcs_categories[front_page]"><option>Select a Page</option>'; foreach( $posts as $p ) { if($r == $p->ID ) {$select = 'selected="selected"'; } $out .= '<option ' . $select . ' value="' . $p->ID . '">' . esc_html( $p->post_title ) . '</option>'; $select = ''; } $out .= '</select>'; echo $out;
but in front page it not displaying post .
it is giving page not found errorhttps://www.ads-software.com/plugins/main-category-as-subdomain/
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to change static page to static post in sub domain setting.’ is closed to new replies.