大佬教程收集整理的这篇文章主要介绍了为帖子缩略图添加主题支持不适用于主题类,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个主题类,我可以在其中引导我的主题并添加主题支持,但没有出现特色图像元框。
类文件内部:
class WCS_theme {
private function __construct() {
$this->setup_hooks();
}
// Singleton design code here
protected function setup_hooks() {
add_action( 'after_theme_setup',[ $this,'setup_theme' ] );
}
public function setup_theme() {
add_theme_support( 'post-thumbnails' );
}
}
\WCS_theme\Inc\WCS_theme::get_instance();
require WCS_DIR_PATH . '/inc/classes/class-wcs-theme.php';
首先,简单地替换
{
var user = await _useRMANager.FindByEmailAsync(Input.Email);
if (user == null || !(await _useRMANager.IsEmailConfirmedAsync(user)))
{
// Don't reveal that the user does not exist or is not confirmed
return RedirectToPage("./ForgotpasswordConfirmation");
}
// For more information on how to enable account confirmation and password reset please
// visit https://go.microsoft.com/fwlink/?LinkID=532713
var code = await _useRMANager.GeneratepasswordResetTokenAsync(user);
var callBACkUrl = Url.Page(
"/Account/Resetpassword",pageHandler: null,values: new { area = "Identity",code },protocol: request.scheR_710_11845@E);
var sendEmailrequest = new SendEmailrequest
{
source = "email@address.fake",DesTination = new DesTination
{
toaddresses = new List<String> { Input.Email }
},message = new message
{
Subject = new Content("Reset Your password"),Body = new Body
{
Html = new Content($"Please reset your password by <a href='{HtmlEncoder.Default.Encode(callBACkUrl)}'>clicking here</a>.")
}
}
};
try
{
await _emailSender.SendEmailAsync(sendEmailrequest);
}
catch(Exception E)
{
logger.LogError("Unable to send password reset email to {0}:{1}",Input.Email,e.messagE);
}
return RedirectToPage("./ForgotpasswordConfirmation");
与
{
return Page();
}
returnUrl = returnUrl ?? Url.Content("~/");
var user = await _useRMANager.FindByEmailAsync(Input.Email);
if (user == null)
{
throw new InvalidoperationException($"Unable to retrieve user.");
}
var result = await _useRMANager.ResetpasswordAsync(user,Input.ResetToken,Input.Newpassword);
if (result.Succeeded)
{
_logger.LogInformation("password reset for user with ID '{UserID}'.",user.UserID);
return LocalRedirect(returnUrl);
}
else
{
_logger.LogInformation("Unable to rest password for user with ID '{UserID}'.",user.UserID);
foreach (var item in result.Errors)
{
ModelState.AddModelError(item.Code,item.Description);
}
return Page();
}
还有, 上面的代码没有出现致命错误,这有点奇怪。 将调试设置为 TRUE 以查看 php 警告。
我认为 WCS_DIR_PATH 存在一些问题。 用
打印完整路径\WCS_THEME\Inc\WCS_THEME::get_instance();
确保它是您文件的正确路径。
以上是大佬教程为你收集整理的为帖子缩略图添加主题支持不适用于主题类全部内容,希望文章能够帮你解决为帖子缩略图添加主题支持不适用于主题类所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。