Tag Info

Hot answers tagged

4

I installed the Lite version of this theme on a test site and dug around. The function that generates the slider doesn't provide any useful filters. However, it does store the IDs of the featured posts in a transient, so you could use the pre_set_site_transient_' . $transient and transient_' . $transient filters to reduce the number of posts. It also ...


2

It is not possible to override header/footer via hooks in respective get_header()/get_header() functions. However it is often overlooked that these function allow input and loading different headers. For example get_header( 'nested/header' ); will look for header-nested/header.php in theme's folder. It's kind of a hack in regards to subdirectory use, but ...


2

Those classes are output by the body_class function, which can be filtered by plugins to add their own classes. You don't need to (and shouldn't) harcode classes into the body tag in your template, just add that function within the body tag: <body <?php body_class(); ?>>


2

The thing about WordPress, while it doesn't have a neat routing system in principle it does same operation. It takes the URL input and matches it to a set of query variables. The not–neat thing about it is that it uses regular expressions for these not–quite–routes and a lot of them. The total number of rules fluctuates from about a hundred minimum to ...


1

Combining wordpress with other frameworks will make it very easy for you to shot yourself in the foot. If all what your clients want is an editor then you can just use tinymce without dragging the whole of wordpress into it, but if they are after the workflow and flexibility then it will be pointless to try to make wordpress something that it isn't. you are ...


1

I solved it. SOLUTION: <?php if ( has_term( 'downloads', 'listen', $post->ID ) ) { get_template_part( 'templates/content-downloads-vergriffener-baende' ); } elseif ( has_term( 'untersuchungen', 'listen', $post->ID ) ) { get_template_part( 'templates/content-untersuchungen' ); } elseif ( has_term( 'studien-materialien', 'listen', ...


1

There is no build in template assigment for indivual standar posts from edit screen. But you can assign templates for individual posts. There are several options: Use WordPress template hierarchy system Under the root folder of your theme you can create this files: single.php for all single posts of any type. single-post.php, if this file exists, it will ...


1

I think your problem has several solutions. If you don't want to have one entry in WP database for each remote item, a possible solution could be to have a page with property slug and add a rewrite rule to get the ID number: add_action( 'init', 'cyb_property_rewrite_rule' ); function cyb_property_rewrite_rule() { add_rewrite_rule( ...


1

Wordpress saves page templates that is assigned to a specific page in the db in the wp_postmeta table. These are saved as follows: 'meta_key' => '_wp_page_template', 'meta_value' => 'NAME_ OF_TEMPLATE' With this in mind, you can loop through pages which shares a specific page template, using get_pages (You can also make use of WP_Query) Example: ...


1

Thanks again to cybmeta for his comments in my earlier question. Of course the solution is to use an archive template. The filename will be archive-foobar.php. The target URL will indeed be mydomain.com/foobar. This works fine, even though for my purposes "archive" is a misnomer. The end user never sees the word "archive". Additionally, using the notes ...


1

Since WP 3.4 page templates can be stored in theme root folder or direct sub-directoryr, that is no problem. But rename page templates, which include moving files to other directories, will unassign that page templates for all pages currently using it. To reassign the page template, simply edit the page, and reselect the desired template. About the ...


1

I think that the most important question here is, Does this functionality add functionality to my theme or to my site? Page templates in general are theme territory and in my opinion should stay in a theme. This does not mean any functionality on which a template depend should be in the theme as well. These meta boxes that you are talking about can either ...


1

your callback function must be like this: function cienna_show_slider_callback() { global $post, $product, $woocommerce; // just in case if your template file need this ob_start(); ?> <?php woocommerce_get_template( 'archive-product.php'); ?> <?php $output = ob_get_contents(); ob_end_clean(); echo $output; die(); }



Only top voted, non community-wiki answers of a minimum length are eligible