custom-wordpress-pages

Keep page hierarchy in wp_list_pages, even if on a child or grandchild

百般思念 提交于 2021-01-29 07:03:00
问题 I have the following structure of pages, and I need to have that same structure displayed on those pages who have child pages: - Childpage - - Grandchildpage - - Other Grandchildpage - Other Childpage The following code is used to display the structure on page.php: <ul class="sidemenu-list"> <?php if($post->post_parent) $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=1"); else $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=1"); if ($children) { ?>

The package could not be installed. The theme is missing the style.css stylesheet

依然范特西╮ 提交于 2020-12-30 03:41:47
问题 I am beginner in WordPress and trying to install theme in it. But I am getting The package could not be installed. The theme is missing the style.css stylesheet. error when I am uploading main .zip file. After getting this solutions I am not able to get Theme folder or .zip file in main folder... my main folder directory is Please anybody suggest me, what should I do? 回答1: Copy caliope folder into ~wordpress_installation_folder/wp-content/themes If you are installing this folder it won't

The package could not be installed. The theme is missing the style.css stylesheet

让人想犯罪 __ 提交于 2020-12-30 03:41:26
问题 I am beginner in WordPress and trying to install theme in it. But I am getting The package could not be installed. The theme is missing the style.css stylesheet. error when I am uploading main .zip file. After getting this solutions I am not able to get Theme folder or .zip file in main folder... my main folder directory is Please anybody suggest me, what should I do? 回答1: Copy caliope folder into ~wordpress_installation_folder/wp-content/themes If you are installing this folder it won't

Warning: Use of undefined constant register_nav_menu - assumed 'register_nav_menu' (this will throw an Error in a future version of PHP)

我与影子孤独终老i 提交于 2020-08-20 12:23:27
问题 Previously i am using PHP 5.6 , i wasn't see that problem ever. But when i am using php 7.3 i saw this problem arise. I am using latest wordpress version 5.2.3 . when I run my wordpress site in top of the page it shows the message Warning: Use of undefined constant `register_nav_menu` - assumed `register_nav_menu` (this will throw an Error in a future version of PHP) in `C:\xampp\htdocs\wordpress\newspaper\wp-content\themes\news\functions.php` on line 14 How can i solve this problem? 回答1:

How to create Feed section in wordpress for homepage

眉间皱痕 提交于 2020-08-10 20:29:05
问题 I am trying to do is, when a user post something from his account it will directly need to show on homepage on wordpress site. This will be for all user's role. Here i want to build a feed page like LinkedIn. Thanks in advance. 回答1: I'm assuming you have some knowledge... You could just add a loop restricted to a specific author... or user by grabbing the user ID. You could do something like this: <!-- Start page loop here --> <?php // 'post_type' => 'any' ... to display all post and custom

How to create Feed section in wordpress for homepage

一曲冷凌霜 提交于 2020-08-10 20:28:06
问题 I am trying to do is, when a user post something from his account it will directly need to show on homepage on wordpress site. This will be for all user's role. Here i want to build a feed page like LinkedIn. Thanks in advance. 回答1: I'm assuming you have some knowledge... You could just add a loop restricted to a specific author... or user by grabbing the user ID. You could do something like this: <!-- Start page loop here --> <?php // 'post_type' => 'any' ... to display all post and custom

get_current_user_id() returning Zero 0

不羁岁月 提交于 2020-08-10 05:03:20
问题 get_current_user_id() is returning 0 for following codes. I do tried some solution available on stack overflow but somehow not working for me. I'm expecting explanation why its returning zero and how to fix? P.S: I'm calling get_current_user_id() from external php page and included '../wp-blog-header.php' for that. Code: <?php require('../wp-blog-header.php'); get_header(); $user_ID = get_current_user_id(); echo $user_ID; ?> 回答1: You have to call wordpress proccess of user authentication. Try

get_current_user_id() returning Zero 0

浪尽此生 提交于 2020-08-10 05:03:12
问题 get_current_user_id() is returning 0 for following codes. I do tried some solution available on stack overflow but somehow not working for me. I'm expecting explanation why its returning zero and how to fix? P.S: I'm calling get_current_user_id() from external php page and included '../wp-blog-header.php' for that. Code: <?php require('../wp-blog-header.php'); get_header(); $user_ID = get_current_user_id(); echo $user_ID; ?> 回答1: You have to call wordpress proccess of user authentication. Try

Custom Avatar upload | Wordpress - No plugin

好久不见. 提交于 2020-06-01 05:08:27
问题 I am trying to allow my users to replace their avatar picture in their profile page. I built a custom wordpress theme and I can get as far as getting the image data with JavaScript and previewing the selected image. How can I then update the current user's avatar? I already have the current user information with $current_user = wp_get_current_user(); Would highly prefer to do this without a plugin, but if its much easier than why not.. 来源: https://stackoverflow.com/questions/62030815/custom

Custom Avatar upload | Wordpress - No plugin

北战南征 提交于 2020-06-01 05:07:47
问题 I am trying to allow my users to replace their avatar picture in their profile page. I built a custom wordpress theme and I can get as far as getting the image data with JavaScript and previewing the selected image. How can I then update the current user's avatar? I already have the current user information with $current_user = wp_get_current_user(); Would highly prefer to do this without a plugin, but if its much easier than why not.. 来源: https://stackoverflow.com/questions/62030815/custom