Page Templates Used in Custom Post Type
Page Templates Used in Custom Post Type
Page Templates Used in Custom Post Type
why get_header doesn’t work twice in a test
I’d recommend Custom Post Types : http://codex.wordpress.org/Post_Types#Custom_Post_Types You can add appropriate meta boxes to each post type : http://codex.wordpress.org/Function_Reference/add_meta_box You can define specific front end templates for each post type : http://codex.wordpress.org/Post_Types#Custom_Post_Type_Templates Instead of a dropdown, you would have distinct menu items for each “thing” ( Review, Albums, etc ).
A simple way to do is to edit your theme’s “search.php” (copying it from the parent theme into your child theme’s directory first if you’re using a child theme) and then before the posts loop putting something like: <?php if ( $tag = get_term_by( ‘name’, get_search_query(), ‘post_tag’ ) ) { ?> <article><!– or whatever is … Read more
Reading the codex on get_template_part and get_post_format will help you a lot here. It’s hard to say for sure without knowing what files are in your theme but get_template_part( ‘content’, get_post_format() ); is essentially saying use the template named content-format.php, where format is one of image, video, gallery etc. One of a few things is … Read more
How to output different content of page on different places in my template
I would suggest you copy page.php into your custom template, and then modify the code as required. At the very least, your template should look something like: <?php get_header() ?> <?php while ( have_posts() ) : the_post() ?> <article <?php post_class() ?>> <?php the_title( ‘<h1 class=”entry-title”>’, ‘</h1>’ ) ?> <div class=”entry-content”> <?php the_content() ?> </div> … Read more
Normally, copying index.php file for the theme as search.php will let you have a new base template to work off of with the same styles and look as your theme, assuming the theme implemented index.php decently. That would give you a solid start to be able to make changes to provided nothing is using a … Read more
You can hook the content of any post and request data you want through WordPress HTTP API. Like this: add_filter(‘the_content’, ‘my_content_178750’, 1, 99); function my_content_178750($content) { return wp_remote_retrieve_body(wp_remote_get(‘http://example.com’)); } Also there is possibility to check path you’re on and decide what you want to get depending on that.
This approach is not advisable as http://example.com/page/whatever-information/ is how WordPress deals with child pages and .htaccess Rewrites is part of how WordPress identifies what page is being requested and what queries to run. You should probably pass the whatever-information as something called a POST variable, then have code that runs on page and parses these … Read more