How i can create a welcome message area for my frontpage with backend control {admin panel}
Welcome
message
How i can create a welcome message area for my frontpage with backend control {admin panel}
message
Create a page theme, then call it in index.php
:
$recent = new WP_Query( 'page_id=**ID**' );
while ( $recent->have_posts() ) : $recent->the_post();
?><h3><?php the_title(); ?></h3><?php
the_content();
endwhile;
Put a loop on the front page limited to posts with the tag "welcomeMessage". Then, on the back end write a post with that tag. Edit the post whenever you want to change the message.
If you are using a static frontpage, you can add the message to a custom field on the post editing screen and then put a shortcode in the page to display it, e.g. [welcome-message]
.
add_shortcode( 'welcome-message', 'echo_welcome_message' );
function echo_welcome_message() {
global $post;
return get_post_meta( $post->ID, 'welcomemessage', true );
}
I don't see how this is really much different than just adding the welcome message to the top of the page content, but hope it helps.