[Feat] Updated the Wordpress Tutorial page in the Layer5 Docs#1047
[Feat] Updated the Wordpress Tutorial page in the Layer5 Docs#1047banana-three-join wants to merge 1 commit into
Conversation
Signed-off-by: Lenox Wiltshire <lenoxwiltshire@gmail.com>
|
Yay, your first pull request! 👍 A contributor will be by to give feedback soon. In the meantime, please review the Layer5 Community Welcome Guide and sure to join the community Slack. |
There was a problem hiding this comment.
Code Review
This pull request updates the tutorial for embedding Meshery designs in WordPress, transitioning from a Media library upload method to enqueuing the design script via the theme's functions.php file. The review feedback identified a syntax error in the provided PHP code snippet, along with several typos and capitalization errors. Additionally, a suggestion was made to avoid redundant script tags in the Custom HTML block since the script is already handled by the theme.
|  | ||
|
|
||
| 4. This will show the `js` file to download and the HTML code snipped to copy. | ||
| 3. This will show the `js` file to download and the HTML code snipped to copy. |
| 5. Now, head over to WordPress and begin by uploading the `js` file to it. Ideally you will upload it to Media. | ||
|
|
||
|  | ||
| 4. Now, create a `js` folder in the path of your current wordpress theme |
|  | ||
|  | ||
|
|
||
| 6. To the following script, replace `design_file_name.js` with the name of the `js` file which you just downloaded. Once this is done, go to the `functions.php` file in your current Wordpress theme and copy script. |
There was a problem hiding this comment.
Minor grammatical improvement ("copy the script"), capitalization fix for "WordPress", and removal of an extra space after the comma.
| 6. To the following script, replace `design_file_name.js` with the name of the `js` file which you just downloaded. Once this is done, go to the `functions.php` file in your current Wordpress theme and copy script. | |
| 6. To the following script, replace design_file_name.js with the name of the js file which you just downloaded. Once this is done, go to the functions.php file in your current WordPress theme and copy the script. |
|
|
||
| ``` | ||
| function kanvas_design_script() { | ||
| $script_uri = get_template_directory_uri() . design_file_name.js'; |
There was a problem hiding this comment.
The PHP code snippet contains a syntax error (missing opening quote) and the path should include the /js/ directory created in step 4 to match the instructions.
| $script_uri = get_template_directory_uri() . design_file_name.js'; | |
| $script_uri = get_template_directory_uri() . '/js/design_file_name.js'; |
| <script src="https://yourwordpressdomain/wp-content/uploads/2025/01/embedded-design-tutorial-exploring-kubernetes-pod.js" type="module" ></script> | ||
| ``` | ||
|  | ||
| 8. Paste the **Embed Code** copied from **Kanvas**. |
There was a problem hiding this comment.
Since the script is already being enqueued via functions.php in Step 6, the user only needs to paste the
| 8. Paste the **Embed Code** copied from **Kanvas**. | |
| 8. Paste the div element from the Embed Code copied from Kanvas. |
|
🚀 Preview deployment: https://layer5io.github.io/docs/pr-preview/pr-1047/
|
Notes for Reviewers
This PR fixes #1046
Signed commits