On click some element i want to use some template
On click some element i want to use some template
On click some element i want to use some template
Based on your pastes, i think what you’re going for is.. function cp_do_pagination() { if( is_home() || is_singular() /* || is_front_page() */ ) return; global $post; // <– do you need this for something in particular? if( !function_exists(‘appthemes_pagination’) ) return; appthemes_pagination(); } The is_singular() function covers is_page(), is_single() and is_attachment(), so no need for the … Read more
You can call get_post_custom() in The Loop, to retrieve an array with all custom fields for a post. In order to fetch a single field, you can use get_post_meta($post_id, $key, $single) with the third argument set to TRUE.
Page templates are special case and since WP 3.4 can be put in subfolder natively. Other than that WP mostly expects flat file structure for templates. While template hierarchy is easily adjusted (see dynamic filter in get_query_template(), pretty much only thing needed)… From personal experience – overly extensive and nested directory structure for templates makes … Read more
WordPress would allow this (sort of). You would still need to create an About page in the back end, but you can tailor your display for such a page 2 different ways: Page Templates Page template hierarchy – What this means is there is a certain order of what WordPress is looking for when displaying … Read more
Yes, what you describe is already built in to the get_template_part() function: <?php get_template_part( $slug, $name ); ?> Where “masthead” is the general template slug in your example, and “custom” is the more specialized version. You’ll have to name your parts slug-name.php (so, masthead-custom.php, rather than custom-masthead.php). Note that you can also use the value … Read more
You can just put something like the following into your template file where you want the form to appear (example of a form called Contact Us): gravity_form(‘Contact Us’, false, false, false, ”, false); For more info on the false etc, see here: http://www.gravityhelp.com/documentation/page/Embedding_A_Form
With this answer with good practices, by Chip Bennett, in mind just do a simple global thing — add global $authordata to your template file: <?php global $authordata; ?> Follow the Codex’s Global Variables article for details about the global practice. Quoting the portion specific to the Question: $authordata (object) Returns an object with information … Read more
You can get the post thumbnail by using get_the_post_thumbnail(): echo get_the_post_thumbnail( $page->ID, ‘thumbnail’ );
The function get_page() has been deprecated, don’t use it anymore, use get_post() instead. get_page_by_title() returns an object by default, you can change this by altering the $output parameter, which you can use like you did. Although get_post() can take an object as $id parameter I personally prefer inputing the ID, but that actually shouldn’t matter. … Read more