change top banner content on specific page

The simplest way is to use conditional tags is_page(), For example <div class=”row-fluid top-banner”> <div class=”container”> <div class=”banner-overlay”></div> <?php $logo = of_get_option(‘logo’, ” ); if ( !empty( $logo ) ) { ?> if ( is_page( ‘contact’ ) ) { <a class=”brand brand-image” href=”https://wordpress.stackexchange.com/questions/114494/<?php echo esc_url( home_url(“/contact/’ ) ); ?>” title=”<?php echo esc_attr( get_bloginfo( ‘name’, ‘display’ … Read more

How to create single page site in WordPress

Create a child theme for your current theme. Read how to here. After that create a file in your child theme named front-page.php. This is the first file WordPress will look for when you visit the home page of your site. To understand why, read here. In that file use: <?php get_header(); $all_pages = get_pages(); … Read more

Toolbar Hidden in a Virtual Page

The admin bar is initialized on template_redirect. You must be short-circuiting that. The quick and dirty method would be to run _wp_admin_bar_init(); near the top of your page. add_filter(‘wp_title’, function($title, $sep, $seplocation) { return ‘Register’; }, 10, 2); _wp_admin_bar_init(); // <- this <- get_header(); get_template_part(‘includes/breadcrumbs’); get_template_part(‘includes/top_info’); It would be somewhat neater to simply hook your … Read more

Making pages in a menu appear conditionally

You can use wp_nav_menu_objects or wp_nav_menu_items hooks to add your filter function. function my_hide_menu_items($objects) { if ( is_admin() ) return $objects; foreach ( $objects as $k=>$object ) { if ( YOUR CONDITION ) { // if $object shouldn’t be displayed unset($objects[$k]); } } return $objects; } add_filter(‘wp_nav_menu_objects’, ‘my_hide_menu_items’, 10, 2);

Query pages based on tags

This is because you haven’t mentioned post_type here and by default post_type is ‘post’ and hence it is missing the pages, add the below in your query ‘post_type’ => array( ‘post’, ‘page’ ) Like this $articles = new WP_Query( array( ‘showposts’ => -1, ‘tag’ => $tag, ‘meta_key’ => ‘date’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘DESC’, … Read more

How do I reference the front page’s parent Page object?

You can get the ID of the front page via get_option( ‘page_on_front’ ). (See also: WordPress option reference.) From there, you can query the page object via get_post(): $frontpage = get_post( get_option( ‘page_on_front’ ) ); Then the content is in the $frontpage object: $content = $frontpage->post_content;