Chip Bennett
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Custom query before default query in single-posttype.phpnot that it matters now, but I was running WP_Query()
Music to my ears! 🙂
Forum: Themes and Templates
In reply to: Custom query before default query in single-posttype.phpHow are you running your custom query, via
new WP_Query()(correct), or viaquery_posts()(incorrect)?If you’re using
query_posts():1. Don’t do that. That function is intended only to modify the primary loop query.
2. UseWP_Query()instead.
3. Then,wp_reset_postdata()will work as expectedForum: Themes and Templates
In reply to: Enqueueing Scripts for Theme Admin Pagesadmin_enqueue_script!=admin_enqueue_scriptsThe actual hook name is the latter; your example above uses the former.
Thanks for catching that typo; I’ve fixed it on the page you linked.
Forum: Themes and Templates
In reply to: [Twenty Eleven] Twenty Eleven Trunk Revision Download?I just checked the latest beta. It still doesn’t have the updated custom header/background code. But, the updated custom header/background code *is* in trunk in SVN. Have a look!
Forum: Themes and Templates
In reply to: [Twenty Eleven] Twenty Eleven Trunk Revision Download?If you’re comfortable with using SVN, I would recommend pulling from here:
http://core.svn.wordpress.org/trunk/wp-content/themes/twentyeleven/It is the easiest way to download the trunk/bleeding-edge version of Twenty Eleven.
Forum: Themes and Templates
In reply to: Listing Links to All Pages Using A Particular TemplateYou may not remember, but if you go back you will see that I tried
var_dump( $product_pages );2 months ago as you suggested.
But did you try it again with @ken Lewis’ code?
Also: you never reported on the
var_dump( $query )request above, regarding theWP_Query()method. Did you get any output from that?Forum: Themes and Templates
In reply to: Listing Links to All Pages Using A Particular TemplateJust saying “nothing works with get_pages” doesn’t help us solve the problem. What output do you get? Anything? Nothing? An error?
Assuming you’re using @ken Lewis’ code, what do you get as output from:
var_dump( $product_pages );Forum: Plugins
In reply to: Is there a way to keep theme settings when it's deactivated?Please don’t bump threads:
http://codex.wordpress.org/Forum_Welcome#No_BumpingThe main person to be able to help you would be the Plugin developer, since what you’re talking about really is a feature request for the Plugin.
Forum: Plugins
In reply to: Is there a way to keep theme settings when it's deactivated?This is a Plugin question, not a Theme question. Hopefully a mod can move it to the correct forum, where you’ll be more likely to get better responses. Also, I’ve tagged it with “virtual-theme”, so that the Plugin developer might see it.
In the future, be sure to post Plugin or Theme-specific questions in the Plugin- or Theme-specific forum. For example, the Virtual Theme Plugin forum is here:
http://wordpress.org/tags/virtual-theme?forum_id=10[Topic moved]
Forum: Fixing WordPress
In reply to: functions.php will not work with child themePlease start your own topic; your issue is actually different from the issue in the OP.
Thanks,
Chip
Forum: Themes and Templates
In reply to: Scrappy by Caroline Moore has html code error@ness2289, you should start your own topic. Your issue is unrelated to the original poster’s.
Forum: Fixing WordPress
In reply to: functions.php will not work with child themeI wanted to add the header and footer. From my understanding, I need to set up the file functions.php for my child theme folder.
What do you mean by “wanted to add the header and footer”? Twenty Eleven already has a header and a footer, so what exactly are you trying to do to the header and footer?
My solution:
Copy everything from the parent theme and save my time…This is both a bad idea, and a counter-productive idea. It is counter-productive, because it defeats the purpose of using a Child Theme. If you truly intend to override everything, then you’re better off just forking the Theme, rather than using a Child Theme.
It is a bad idea because, as you’ve found out,
functions.phpcan’t simply be copied from the parent Theme into the child Theme. While the template files are executed as an either/or proposition (if it exists in the child, the child-Theme version is used; otherwise, the parent Theme version is used), thefunctions.phpfile is a both/and execution: the child Theme’sfunctions.phpis executed, and then the parent Theme’sfunctions.phpfile is also executed. SO, you can’t declare (i.e. define) the same functions in both the parent and in the child Theme.My Problem:
I received the same error. So then I added a the following to line 318 of my child them:if(!funcion_exists ( twentyeleven_excerpt_length )){
}But received a:
Fatal error: Call to undefined function function_exists()You’ve not copy-pasted your error message. Note the difference between:
if(!funcion_exists (...and:
Call to undefined function function_exists()(Hint: you misspelled
functionasfuncionin the former, which is why you’re getting the undefined function fatal error.)But how would I write my function.php file the way it is supposed to be without the need of copying the entire parent function.php file?
Start with a blank – or even a nonexistent –
functions.phpfile in the child Theme. You may or may not even need it; but start there, and make sure all of your style and template changes are working. Only then should you even worry about any functional changes you want to make.And then, as I stated in the beginning: please describe the exact functional changes you’re wanting to make, so that we can help you implement them.
Forum: Themes and Templates
In reply to: Listing Links to All Pages Using A Particular Templatestill nothing…
To troubleshoot, use:
<?php var_dump( $query ); die; ?>And see if the
$queryobject is populated.Do I use “echo” for the second part?
What, exactly, are you trying to do?
Forum: Themes and Templates
In reply to: Listing Links to All Pages Using A Particular TemplateSo I tried:
$query = new WP_Query( array( 'meta_key' => 'wp_page_template', 'meta_value' => 'product.php'based on the instructions in that link and it did not return any results. Was I using it wrong?
Partly. This:
'wp_page_template'…needs to be this:
'_wp_page_template'Also, this query assumes that your custom page template file name is
product.php. If it isn’t, you’ll need to modify'meta_value'accordingly.Forum: Themes and Templates
In reply to: resolvedPlease don’t edit your posts or the topic title to delete all explanatory information. These support forums are a community resource, used to provide a knowledge base from which others can find answers to similar issues/problems.
If the issue is resolved, post a follow-up message indicating the fix, and then mark the topic as “resolved” in the options to the right —————————>