[theme-reviewers] Is Blog.php is allowed in theme?
Chip Bennett
chip at chipbennett.net
Sat Jul 5 22:52:32 UTC 2014
I've read all of those replies. I disagree in principle with circumventing
the Template Hierarchy because Plugin developers don't know how to read the
Codex to understand what the is_home() conditional is used for.
is_home() <http://codex.wordpress.org/Function_Reference/is_home> = returns
true when the current context is the blog posts index
is_front_page()
<http://codex.wordpress.org/Function_Reference/is_front_page> = returns
true when the current context is the site front page
The is_home() query conditional has absolutely nothing to do with the site
front page context. Using is_home() to display something only intended to
display on the site front page is therefore going to cause problems. The
solution is not to circumvent the Template Hierarchy, but rather to *use
the correct query conditional*.
On Sat, Jul 5, 2014 at 5:47 PM, Philip M. Hofer (Frumph) <philip at frumph.net>
wrote:
> Please re-read my replies that you didn’t read to begin with and you
> will note that plugins and other actions and events that occure on the
> is_home() are executed as I have said previously and that I have argued
> that fact that using the page template is the way to avoid that.
>
>
>
> *From:* Chip Bennett <chip at chipbennett.net>
> *Sent:* Saturday, July 05, 2014 3:41 PM
> *To:* Discussion list for WordPress theme reviewers.
> <theme-reviewers at lists.wordpress.org>
> *Subject:* Re: [theme-reviewers] Is Blog.php is allowed in theme?
>
> I didn't say anything about *Plugins*. I asked if the core settings,
> as-defined, work correctly. They do. FULLSTOP.
>
> Now, that doesn't mean that Plugins are developed correctly. That could
> very well be a problem.
>
> What three Plugins, specifically?
>
> And, I'll still buy you that beer if I'm wrong here: *one or all of those
> Plugins incorrectly use(s) is_home() when intending to output something
> conditionally only on the site front page*.
>
> There's a lot of confusion between is_home() and is_front_page(). The
> solution is not to allow Themes to facilitate poor coding; rather, the
> solution is to read the Codex, and submit patches to incorrectly coded
> Plugins. ;)
>
>
> On Sat, Jul 5, 2014 at 5:38 PM, Philip M. Hofer (Frumph) <
> philip at frumph.net> wrote:
>
>> It doesn’t work correctly, I have 3 plugins (made by various people)
>> that are outputting their content onto the blog page.
>>
>> One of which is a slider, quite annoying.
>>
>> You owe me a beer [image: Winking smile]
>>
>> As I said, if you want to have a blog loop that doesn’t have anything to
>> do with is_home() then the page template is the way to go.
>>
>>
>> *From:* Chip Bennett <chip at chipbennett.net>
>> *Sent:* Saturday, July 05, 2014 2:45 PM
>> *To:* Discussion list for WordPress theme reviewers.
>> <theme-reviewers at lists.wordpress.org>
>> *Subject:* Re: [theme-reviewers] Is Blog.php is allowed in theme?
>>
>> Activate 2012/2013/2014 on a clean install, no Plugins, no
>> configuration changes. Try the instructions I and Otto have posted, for
>> correct, core-defined configuration for a static front page. If it doesn't
>> work, the next beer's on me.
>>
>>
>> On Sat, Jul 5, 2014 at 4:37 PM, Philip M. Hofer (Frumph) <
>> philip at frumph.net> wrote:
>>
>>> And you do not read responses apparently.
>>>
>>> I’m going to stop replying to this because frankly, you have no idea
>>> beyond what you’ve read and never actually utilized it with real world
>>> applications.
>>>
>>>
>>>
>>> *From:* Chip Bennett <chip at chipbennett.net>
>>> *Sent:* Saturday, July 05, 2014 2:33 PM
>>> *To:* [theme-reviewers] <theme-reviewers at lists.wordpress.org>
>>> *Subject:* Re: [theme-reviewers] Is Blog.php is allowed in theme?
>>>
>>>
>>> Sorry, but you're simply wrong. You don't need to do any of that.
>>>
>>> I've given all of the necessary steps, several times:
>>>
>>> 1. Create 2 static pages, A and B
>>> 2. Settings -> Reading -> Front page displays = "a static page"
>>> 3. Settings -> Reading -> Front page = "Page A"
>>> 4. Settings -> Reading -> Posts page = "Page B"
>>>
>>> That's it. All done. No FTP or other FUD required.
>>> On Jul 5, 2014 5:01 PM, "Philip M. Hofer (Frumph)" <philip at frumph.net>
>>> wrote:
>>>
>>>> This is the tech support conversations to enable someone to have a
>>>> blog on a separate page, comparison.
>>>>
>>>> Scenario 1 (your considered “proper” way)
>>>>
>>>> 1. First, FTP into your site. Yes, FTP; you can watch some youtube
>>>> video’s on learning how to ftp. Contact your hosting to get your info
>>>> properly.
>>>>
>>>> 2. Navigate to the wp-content/themes/yourthemename/ and copy the
>>>> index.php and name is front-page.php .. yes, copy.. yes, you need to first
>>>> move the index.php file to your local drive then .. you don’t know how to
>>>> do that? okay let me explain ... ( 5 mins later )
>>>>
>>>> 3. Okay now that you have that, you can go to settings –> reading and
>>>> enable the posts page to be a page you created, .. okay yeah so create a
>>>> page yes, a page .. you’ll need to create 2 pages, call one “Home” and the
>>>> other “Blog” (or) “posts page”
>>>>
>>>> 4. Okay you did that? fine, set those in the settings –> reading,
>>>> choose which pages you want to display where.
>>>>
>>>> 5. Cool beans, you’re done. What? That plugin you paid $50 for is
>>>> displaying on the posts page too? .. I’m sorry you’re going to have to
>>>> take that up with that plugin maker. Oh, that one too? damn people don’t
>>>> know how to program.
>>>>
>>>> 6. I realize that it’s pretty complicated, but that’s the way the theme
>>>> review team wants to have it done, I apologize profusely.
>>>>
>>>> --------------------------------------------
>>>>
>>>> Scenario 2:
>>>>
>>>> 1. Go to pages –> add new and create a blog page, in the right column
>>>> associate the “blog” template to it.
>>>>
>>>> 2. Go to the theme settings and disable the blog loop from appearing on
>>>> the home page.
>>>>
>>>> 3. You’re welcome!
>>>>
>>>>
>>>> ---------------------------------
>>>>
>>>> Yeah, rather stick with my method.
>>>>
>>>> *From:* Otto <otto at ottodestruct.com>
>>>> *Sent:* Saturday, July 05, 2014 1:20 PM
>>>> *To:* Discussion list for WordPress theme reviewers.
>>>> <theme-reviewers at lists.wordpress.org>
>>>> *Subject:* Re: [theme-reviewers] Is Blog.php is allowed in theme?
>>>>
>>>> Okay, that's not a theme template, that is a Custom Page Template
>>>> with a custom loop, and no, that sort of thing should not be allowed in any
>>>> theme in the WordPress.org theme directory. In short, that is an incorrect
>>>> way to show the main blog posts on a page.
>>>>
>>>> There's nothing wrong with making Custom Page Templates to show special
>>>> things, but the "main blog" is not a "special thing"... and it is correctly
>>>> handled by the core Template Hierarchy. The home.php file should be what
>>>> you use to display the blog posts, and you should not have a custom query
>>>> in it like that.
>>>>
>>>> The reason that is wrong is because it doesn't correctly support the
>>>> core functionality for setting a Page to appear on the front-page, and for
>>>> the blog posts to appear on a sub-page. With this implementation, somebody
>>>> has to make a Page and also set it to be using this Page Template, and then
>>>> also set the Settings->Reading settings incorrectly as well.
>>>>
>>>> See, if you have the Settings->Reading settings set correctly, with
>>>> both the Front and Posts pages set to some values, then it is not possible
>>>> for the Page to use your custom Page Template. So your "blog.php" here will
>>>> not get used unless you also instruct the user to set up the site
>>>> incorrectly (aka, incompletely). The correct way is to use the home.php to
>>>> do a normal Blog loop, and then that will be used no matter where the blog
>>>> posts are displayed, as long as the site is set up correctly.
>>>>
>>>> -Otto
>>>>
>>>>
>>>> On Sat, Jul 5, 2014 at 1:13 PM, Philip M. Hofer (Frumph) <
>>>> philip at frumph.net> wrote:
>>>>
>>>>> it’s a template that themes have that do the blog loop that can be
>>>>> associated to a page, either custom for specific categories are all
>>>>>
>>>>> “there’s no way to display it using any other template file”
>>>>>
>>>>> This is what I use, works fine:
>>>>>
>>>>> <?php
>>>>> /*
>>>>> Template Name: Blog
>>>>> */
>>>>> get_header();
>>>>>
>>>>> $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
>>>>>
>>>>> $blog_query = array(
>>>>> 'paged' => $paged,
>>>>> 'post_type' => 'post',
>>>>> 'in_the_loop' => true,
>>>>> 'posts_per_page' => comicpress_themeinfo('home_post_count')
>>>>> );
>>>>>
>>>>> $wp_query = new WP_Query(); $wp_query->query($blog_query);
>>>>> if (have_posts()) {
>>>>> while (have_posts()) : the_post();
>>>>> $withcomment = 0;
>>>>> get_template_part('content', get_post_format());
>>>>> endwhile;
>>>>> comicpress_pagination();
>>>>> }
>>>>>
>>>>> wp_reset_query();
>>>>>
>>>>> get_footer();
>>>>>
>>>>>
>>>>> *From:* Otto <otto at ottodestruct.com>
>>>>> *Sent:* Saturday, July 05, 2014 11:00 AM
>>>>> *To:* Discussion list for WordPress theme reviewers.
>>>>> <theme-reviewers at lists.wordpress.org>
>>>>> *Subject:* Re: [theme-reviewers] Is Blog.php is allowed in theme?
>>>>>
>>>>> On Sat, Jul 5, 2014 at 12:48 PM, Philip M. Hofer (Frumph) <
>>>>> philip at frumph.net> wrote:
>>>>>
>>>>>> The blog template is the point I was making in the first place,
>>>>>> where if you do *not* want the is_home or is_front_page events to execute,
>>>>>> that is the only way to bypass that; which makes having a blog.php useful.
>>>>>>
>>>>>>
>>>>>
>>>>> No, I mean, there is nothing in the code that I can find for
>>>>> "blog.php" at all. It's not mentioned in the Template Hierarchy, there's
>>>>> nothing in the template.php core file that mentions it. So, what exactly is
>>>>> this "blog.php" to which you refer?
>>>>>
>>>>> As far as I know, if you're displaying the results of the main posts
>>>>> query, then you're doing it on front-page.php, home.php, or index.php.
>>>>> There's no way to display it using any other template file.
>>>>>
>>>>> -Otto
>>>>>
>>>>> ------------------------------
>>>>> _______________________________________________
>>>>> theme-reviewers mailing list
>>>>> theme-reviewers at lists.wordpress.org
>>>>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>>>>>
>>>>> _______________________________________________
>>>>> theme-reviewers mailing list
>>>>> theme-reviewers at lists.wordpress.org
>>>>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>>>>>
>>>>>
>>>> ------------------------------
>>>> _______________________________________________
>>>> theme-reviewers mailing list
>>>> theme-reviewers at lists.wordpress.org
>>>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>>>>
>>>> _______________________________________________
>>>> theme-reviewers mailing list
>>>> theme-reviewers at lists.wordpress.org
>>>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>>>>
>>>> ------------------------------
>>> _______________________________________________
>>> theme-reviewers mailing list
>>> theme-reviewers at lists.wordpress.org
>>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>>>
>>> _______________________________________________
>>> theme-reviewers mailing list
>>> theme-reviewers at lists.wordpress.org
>>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>>>
>>>
>> ------------------------------
>> _______________________________________________
>> theme-reviewers mailing list
>> theme-reviewers at lists.wordpress.org
>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>>
>> _______________________________________________
>> theme-reviewers mailing list
>> theme-reviewers at lists.wordpress.org
>> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>>
>>
>
> ------------------------------
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20140705/d4bf84b3/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wlEmoticon-winkingsmile[1].png
Type: image/png
Size: 1130 bytes
Desc: not available
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20140705/d4bf84b3/attachment-0001.png>
More information about the theme-reviewers
mailing list