custom post creation on front page – on submit a search is done
add the_permalink(); in form action value, to submit the form data. <form id=”fep-new-dog” name=”new_dog” method=”post” action=”<?php the_permalink(); ?>”>
add the_permalink(); in form action value, to submit the form data. <form id=”fep-new-dog” name=”new_dog” method=”post” action=”<?php the_permalink(); ?>”>
You need only a bit of logic while setting the parent variable. After that is better using the standard wordpress function get_pages instead of using a raw $wpdb query. Then, once you use setup_postdata for the pages, you can use the standard template tags instad of echo the raw page object properties. Finally after the … Read more
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
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
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
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);
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
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;
Finally found a workaround. I used UberMenu the WordPress plugin to insert images into menus which I then set on a per page basis.
There’s nothing magical about it, your post type doesn’t have an archive ( has_archive is false ), so there’s no rewrite rule for your post type that matches just /%post_type%/, the only existing rules for your post type are for /%post_type%/%some_other_thing%/, so there’s no clash with your page.