vincent7892
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Create custom route for API, get only one userOk I’ve manage to got both my answer by myself :
I was not adding each new object in the foreach loop but replacing the one before…
So :function getUsersMeta() { $obj = new stdClass(); $users = get_users( array( 'fields' => array( 'ID' ) ) ); //var_dump($users); $i = 0; foreach($users as $user){ $i = $i + 1; $index = strval( $i ); $myObj = new stdClass(); $myObj->rue = get_user_meta($user->ID,'rue',true); $myObj->cp = get_user_meta($user->ID,'cp',true); $myObj->ville = get_user_meta($user->ID,'ville',true); $myObj->structure = get_user_meta($user->ID,'structure',true); $value = "object ".$index; $obj->$value = $myObj; } return $obj; }About how JSON is written, my data seems to already BE JSON data so I don’t need json_encode() at all.
Forum: Developing with WordPress
In reply to: Child theme not loading style.cssOk,
I don’t understand why your theme URI is set to : https://diviextended.com/
I assume you got this here :
https://diviextended.com/download-wordpress-twenty-twenty-one-child-theme/The parent style is still loaded as it is not supposed to “vanish”… did you try to modify any css property in your child.
(like a body{display: none!important;} that would for sure have a visible effect.
Child modifications override parent’s rules… so If you don’t write anything in child’s style.css, it won’t do anything.Also refresh your cache.
- This reply was modified 5 years, 2 months ago by vincent7892.
- This reply was modified 5 years, 2 months ago by vincent7892.
Forum: Developing with WordPress
In reply to: Child theme not loading style.cssHi,
I think you might have missed the step where you enqueue your style.css in your child’s function.php.
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); function my_theme_enqueue_styles() { wp_enqueue_style( 'child-style', get_stylesheet_uri(), array( 'parenthandle' ), wp_get_theme()->get('Version') // this only works if you have Version in the style header ); }Step 6 here :
https://www.hostinger.com/tutorials/how-to-create-wordpress-child-theme