Tagged Questions
0
votes
1answer
23 views
Is it possible to have a Theme with built-in physical page files?
I am creating a theme and was thinking if it would be possible to create pages within my theme folder that would reflect the wordpress url + path.
So for example I could when accessing: ...
0
votes
0answers
12 views
Get template part with Except [duplicate]
I am using
<?php
wp_reset_query();
query_posts('posts_per_page=20&post_type=post&post_status=publish');
get_template_part('index');
?>
in single post bottom. Its ...
0
votes
1answer
90 views
Conditional get template part
My index page look like this...
<div id="ad-id">google ad code goes here </div><br />
<div id="post-id">My posts are goes here</div>
I use
...
0
votes
1answer
80 views
Organize template parts and page templates in folders in regards of template hierarchy
Hello and happy new year
Suppose one has a large theme composed of several post types, page templates and a bunch of custom loops and template parts which is best keeping in separate php files. ...
2
votes
2answers
192 views
How to move style from template file to <head> section?
Imagine the following situation:
//header.php contains:
<header id="header">logo and navigation</header>
//my-template.php contains:
<?php get_header(); ?>
<style ...
3
votes
1answer
2k views
Variable use in get_template_part
As far as I understand (from the get_template_part codex) get_template_part is just a wrapper round the PHP require function.
So if I have a variable that I have create in a page template file e.g. ...
1
vote
1answer
97 views
Unexpected results with conditionals inside template part
Scenario: I have a template part loop-product.php which i am calling from home.php, taxonomy.php and a page template template-products.php. Inside that template part loop-product.php file i am setting ...
0
votes
2answers
324 views
wordpress header leaks into body in a specific template
very strange problem, that happens only in one specific template. part of the part "leaks" into the tag - and I can't figure out why.
the "header.php" code:
<!DOCTYPE html>
<html ...
4
votes
4answers
3k views
When is get_template_part() preferable to simply using the template.php files?
In this post on wordpress.stackexchange.com I asked whether using get_template_part(), as demonstrated in the TwentyTen theme, is a recommended best practice. The general consensus I got was that it ...