Parse error: syntax error, unexpected ‘echo’ (T_ECHO) in C:xampphtdocsAttendanceSystemresourcesphpmethod.php on line 250

How to echo php variable in html that in String $body = '<p style="font-size: 18px; line-height: 1.2; text-align:; word-break: break-word; mso-line-height-alt: 22px; margin: 0;"><span style="color: #2b303a; font-size: 18px;"><strong>Name: </strong><span style="font-size: 16px;">'echo $student_name'</span></span></p>' Answers: Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue … Read more

HTML comment cause issue in functions.php script root

I noticed HTML comment tag <!-- --> will cause issue on themes functions.php script if it is in the root of script(not inside a function).
I was working on my themes functions.php to add some Easy Digital Downloads action/filter, which i realized purchase button will continue to loading and doesnt add product to basket.
after clearing an html comment that was in the root of script,issue solved. i need to know whats wrong with having HTML comment in functions.php root ?

dynamic php menu with hidden sub-categories only showing when the category name is clicked

This is for a wordpress store and I want to show the categories names automatically, but with the sub-categories hidden, the code below works perfectly with the hover effect, now I wish to have the click effect instead. The $cats variable is to use the get_terms() function, but for here to work everywhere I had included a few categories, the categories only go so far as the “third generation”.

Accessing WordPress data via JSON gives HTML data for certain keys

I am creating an Android app for a client whose site is in WordPress. I want to access the posts, but I don’t know which API to hit. One of the APIs I found after some searching is https://www.<mysite>.com/wp-json/wp/v2/posts. This gives a ton of key value pairs, So I was tying to access this site via this URL. But for a particular content key, this is giving the following output: