When making HotNews pro2.6 upgrade, integrate the functional modules on the side into the WP gadget, and start using the method(Detailed methods can be found here)There is a defect that the customized gadget after use cannot be used again after the page is refreshed.Last ReferenceThis tutorial for foreignersAnd officialCodexAfter simplification, the final code is as follows:
<?php
class news extends WP_Widget{
function news(){
$widget_options=array ('classname '=>'set_contact', 'description'=>'Customize the latest articles');
Multiple custom widgets can modify the news text and the imported custom code file. The advantage of this official Widgets API method is that the custom widget can be reused.The article comes from the knowledge that more birds-https://zmingcx.com/another-way-to-add-customizable-gadget-method.html
The original tutorial code has many function setting options, which are somewhat complicated and have been simplified by me. If you want to further enhance the functions of the gadget, you can refer to the following article to try to toss about.The article comes from the knowledge that more birds-https://zmingcx.com/another-way-to-add-customizable-gadget-method.html
Widgets APIThe article comes from the knowledge that more birds-https://zmingcx.com/another-way-to-add-customizable-gadget-method.htmlThe article comes from the knowledge that more birds-https://zmingcx.com/another-way-to-add-customizable-gadget-method.html
Most of the articles on this site are original and used for personal learning records, which may be helpful to you, for reference only!
After I use your theme, enter one of the categories, such ashttp://ynono.com/category/keep-beautifulOn the page, I found the prompt Warning: include (includes/random. php) [function. include]: failed to open stream: No such file or directory in/home/aonion/domains/ynono. com/public_html/wp content/themes/HotNewspro/archive.php on line 97
Warning: include() [function.include]: Failed opening ‘includes/random.php’ for inclusion (include_path=’.:/usr/local/php5/lib/php’) in /home/aonion/domains/ynono.com/public_html/wp-content/themes/HotNewspro/archive.php on line 97 Can you take a look at it for me
@YuannuonoIt seems that you have used the previous version of this theme, and the theme still has the residual code of the previous version. Click to restore the default in the theme setting, and pay attention to backing up the content entered previously
Brother Bird, let me ask you something.Is the wp version you installed the official Chinese version or the official English version+Chinese language patch (unofficial) Thank you!
add_action(‘widgets_init’,create_function(”, ‘return register_widget(“news”);’)); How to expand this?It is not allowed to copy it once. Change news to news, and post is also not allowed. Solve.