Headless WordPress with Next JS as front end

ref – https://torquemag.io/2021/05/next-js-headless-cms/

Step 1: Installing WPGraphQL to query WordPress with GraphQL

To start, we’ll need to install the WPGraphQL plugin, which will allow us to query our WordPress data with GraphQL.

You can easily install WPGraphQL by heading to the Plugins section of your WordPress admin dashboard, searching for WPGraphQL, installing the plugin, and activating it.

But once you’re ready, you should be able to visit the /graphql page in your browser for your WordPress site, where you should see a GraphQL-related error, meaning we’re ready to use GraphQL.

Step 2: Creating a new Next.js WordPress blog with Next.js WordPress Starter
If you’ve created a new Next.js website before, such as using Create Next App, this part should be pretty familiar to you!

To create our new website, head to your terminal, and run the following command:


npx create-next-app -e https://github.com/colbyfayock/next-wordpress-starter penguin-app-blog

Running this command will use the Next.js Create Next App command line tool to:

– grab a copy of the Next.js WordPress Starter template,
– clone it to a local directory
– install all of the dependencies

so that we can get quickly moving with our project.

Now, before we actually start our new project, we have to do one more thing.

Inside of your new project, we need to create a new file called .env.local, where we’ll store our WordPress API endpoint to let our code know where to pull the content from.

After creating .env.local inside of your project, add the following:

so in my case:

Summary an Essay

ref –

  • https://www.youtube.com/watch?v=bhtz7RSaKlc
  • https://docs.google.com/document/d/1YZ_R5BhplfoRsJ_Mliw3tJ4JH6P0YfTy1jK3mmxhEqs/edit

Transitions

  • First of all,
  • Next,
  • After that,
  • Then,
  • Finally

Opening Sentences

Article/book title
Writer’s name
Main idea/claim

List ideas in paragraph form, in the same order they appeared in the original article.

Never include your opinion

Just report what was originally read.

Example

Introduction

Analyze and extract get the thesis from the article:

“I have three guiding principles that anchor my life”

Therefore, we’re looking for those three guiding principles in detail.

1) Unquenchable thirst for knowledge – I consider myself a perpetual student. Because of this, I rarely get bored.

Reason – knowledge is connected to the truth.

2) Strive for excellence. Being a perfectionist and constantly trying to improve himself. He’s a perfectionist. It has made him a better physician and scientist.

He has accepted that he will never know or understand as much as he wants.

3) Serve humankind.

Details

1) – research, care of patients, public healthy policy of AID/HIV
I am committed to confronting the enormity of this global public health catastrophe and its potential for greater devastation.

Writing it

Main idea – three guiding principles that anchor my life

1) Never ending search for knowledge
2) Because knowledge is connected to truth
…etc.

In the article “A Goal of Service to Humankind”, Dr Anthony Fauci discusses the most important principles that guide his life.

The first guiding principle is a never ending search for knowledge.
(what does that mean?)
He considers himself to be a perpetual learner. As a result, he’s never bored.

The second principle is aiming for excellence. He is a perfectionist and is constantly trying to do his best, which has made him a better physician.

The last principle is his goal to serve other humans. He has spent all his professional life in service to others. In the 1980s, when AIDS became a global health health crisis, he committed himself to solving this problem, and he is still committed to ensuring that this disease does not produce even greater devastation.

Supplement

How to Write a Summary in English

Summary Checklist:
The first sentence tells the article title in quotation marks.

The first sentence uses a verb in simple present (discusses, explains, or describes)

The first sentence includes the writer/author and the main idea/claim/topic.

Example first sentence:

In the article “A Goal of Service to Humankind,” Doctor Anthony Fauci discusses the three principles that guide his life as a physician.

The summary clearly shows the main points of the article with transitions like “first of all” and “next.”

The summary tells the main points in the same order that they appeared in the article

The summary uses the student’s own words and does not copy from the article.

The ideas of the article are clear in the summary. (1-2 sentences of supporting details can be added if the idea is not clear.)

The summary does not include unnecessary details.

The summary is objective; it does not include the student’s opinion.

Optional: the summary concludes with a sentence to summarize the main points.

The grammar, vocabulary, and sentence structure are good.

Steps to Write a Summary:

Read and understand the article. You need to read more than once.

Read critically: use 2 highlighters to identify main ideas and supporting details. Draw lines to separate the article into sections. If the article is hard or long, you can also do these two optional things: make margin notes and cross out ideas that are not important.

Make a list of the important ideas in your own words. This outline is a great way to make your summary easy and to avoid copying from the article.

Use your outline to write your summary.

Remember the characteristics of a good summary:
Clearly organized with transitions
Short but not too short
Ideas are clear. A little detail can be added, but not too much.
Do not add your opinion!

Jack 8/6

Present Simple

Subject + verb + object

Jack (3rd singular) plays basketball.
Everything else is standard verb form.

They play ball.
They are great!

Jack and Ricky (they) play soccer.

The turtle has a small round head.
Ted moves very slow.

Present Perfect

Past —√ —— Now √

Starts in the past
It exists, or holds true right now.

Jack has played basketball since he was four years old.

Subject + [has/have] + past participle

3rd person singular –> has
Everything else –> have

I have played soccer since I was in middle school.

Ted and Randi have been friends since birth.

Present Continuous

to be [am, is, are] + action verb [present participle]

I am teaching Jack English.
I am having lunch.

Present Perfect Continuous

[have/has] + [been] + (present participle)

Randi has been practicing on his take off.
[Ted and Randi] have been discussing a competitive race for the last day!

Prepositions (on, at, in)

ref – https://www.basic-english-grammar.com/8-types-of-prepositions-in-english-grammar-with-examples.html

When you refer to something with a surface, use preposition on

The clock hangs on the wall.
The books are on the table.
The names are etched on the tombstones.
The graffiti on the wall must be removed.

When you refer to something inside or confined, use in.

The cookies are in the cabinet.
The ice cubes in the glass are melting.
David left the book in the car.

When you refer to a specific point in time or place, use at.

I will meet you at midnight.
Let’s meet up at Terry’s.
Rebecca will meet us at 8pm sharp.
The group will congregate at the church.

Use in when you refer to years, months, seasons, centuries, and time of day.

Disco was popular in the 70s. (years)
Life was hard in the 19th century. (centuries)
It is always humid in the Summer. (seasons)
It is always hot in January. (months)
The light is always perfect in the morning and in the evening, but way too bright in the afternoon. (time of day)

Use on when you refer to days, dates, and specific holidays.

I have tuna sandwiches on Mondays, Wednesdays, and Fridays. (day)

I workout only on the weekends. (day)

I want to give you a gift on this special day because you are my best friend. (day)

On August 6th, 1920, my beloved grandmother was born. (dates)

On June 6th, 1946, Allied troops stormed Omaha beach in West Germany. (dates)

I always get a lot of present on Christmas. (holidays)

Shoppers are often frantic on New Year’s Eve. (holidays)

Use at when you refer to time exceptions and festivals.

We’ll be having fun at Mardi Gras! (festival)

I work best at night. (time exception)

Let’s do this at two o’clock. (time exception)

I’m feeling down at the moment. (time exception)

Sherry – 8/3

1) inn – establishment for the lodging. (old school hotel)

win w-inn

1) kua
2) yet

quiet kua-yet

1)

  • turbo = tur-bo
  • turbine = tur-bine
  • turquoise = tur-quoise

2) dull = boring, lack of sharpness

turtle tur-dull

1) Radical – ra-di-cal (adj): very different from the usual or traditional (extreme)
2) bit – The dog bit me.

rabbit Ra-bit

wants wan-ts

1) for (4)
2) were

forward for-word

Homework

Re-read your turtle/rabbit story, with these corrections.

Sherry 7/30 – 2pm

7/30

ref:

  • https://chineseruleof8.com/2023/05/02/present-simple/
  • https://chineseruleof8.com/2023/07/29/basic-sentence-structure/

Class content – Present Simple

What is a pronoun?

In English grammar, pronouns are a type of generic noun that can represent any other noun. Their job is to make communication faster and more efficient because you don’t have to repeat the same word over and over again. Some pronoun examples include:

First person – I/me (singular) We (plural)
Second person – You (singular/plural)
Third person – He/she/it/Ricky (singular) They/them (plural)

What are verbs? (actions)

jump/jumps
drink/drinks
play/plays
run/runs

verbs that end with (tch, y, zz):

match/matches
fly/flies
quiz/quizzes

If subject is 3rd singular, (verb + ‘s’)

  • (She) [eats] a lot of vegetables.
  • (He) [eats] too much meat.
  • (Monica) [loves] to wear perfume.
  • (Andy) only [buys] silk.
  • (Jimmy) [needs] two pairs of running shoes.

Else, we use simply use the normal verb form.

  • (We) [love] chocolate!
  • (They) [sell] too fast
  • (They) [price] the items too high
  • (Coconuts) [replenish] the body best.
  • (You) [look] great!
  • Those (shoes) [match] your outfit
  • That (perfume) [smells] lovely
  • I work out religiously (adverb)
    An adverb is a word that:

    • describes a verb (“he (sings) [loudly]”)
    • an adjective (“[ridiculously] (tall)”)
    • whole sentence (“[Fortunately], (I had brought an umbrella).”)
  • Sherry loves coffee.
  • Xiao Fei loves coffee.
  • (Sherry and Xiao Fei) [love] coffee!

10 vocabulary words (with custom audio):

  • Hobbies

    • (I) [exercise] daily.
    • (I) [take] my little dog out for a stroll every night.
    • (I) [take] selfies in front of gym mirrors.
    • (She) [cooks] from scratch.
  • Unchanging Situations

    • (I) [run] a branch office in Shaoxing for my boss.
    • (I) [drive] my car to work every morning
    • But on Fridays, (I) [take] the bus to work because of traffic.
    • (They) [vacation] in Thailand every winter
  • Homework

    cake

    1) K (the letter itself)
    2) ke

    K ke

    car

    1) ke
    2) R (the letter itself)

    Ke-R

    tea

    T

    coffee

    1)

    Saw – past tense of see.
    Now, just like ‘saw’, read it with a K, Kaw.

    Fee – a small charge.

    Kaw-Fee

    milk tea

    1) Mill
    2) ke (very short, and connect it to T)
    3) the letter ‘T’

    Mill ke-Teee

    million

    1) Mill
    2) Lee yen

    Mill Lee-Yen

    pencil

    1) Pen
    2) soul – spirit of the person

    pen soul

    sandwich

    1) San
    2) which

    San-which

    San-which
    ten San-WhiJizz please.

    school

    Skool

    smile

    1) Sss
    2) mile – distance of 1760 feet

    Ssss-mile

    smell

    1) Ssss
    2) Mel

    Ssss-Mel

    25 examples each of present tense:

    • 3rd singular + verb’s’
    • NOT 3rd singular + verb
    • subj1 AND subj2 + verb
    • subj1 OR subj2 + depends on subj2

    Finish describing the ‘tortoise and the hare’ image using present simple only.

Trevor 7/28/2023

I (have/has) a headache.

You (have/has) a new laptop.

They (have/has) three cats.

She (have/has) a big house.

It (have/has) been a year since we (have/has) talked.

Jacob (has/have) done the job perfectly. All the teachers (have/has) appreciated his efforts.

(Have/Has) you replied to the mail? Your sister (has/have) already replied to it.

She (have/has) a house in Bengaluru.

Melissa (have/has) a joint injury.

I (have/has) visited Singapore twice.

They (have/has) taken part in the cultural program.

Peter often (have/has) noodles for lunch.

What would you like to (have/has): tea or coffee?

I (have/has) had snacks just an hour ago.

He (have/has) to pay the electricity bill by today evening or else penalty will apply.

Plan B (has/have) to work properly.

You (has/have) to perform the dance otherwise you will be disqualified.

I (has/have) to meet him before he moves to another city.

Those dresses (has/have) stripes.

Roger and I (has/have) a red car.

My dog and Patricia’s cat (has/have) brown fur.

M visa needs

Visa checklist

√ (1) Passport and Passport photocopy: original passport with at least one blank visa page and valid for at least 6 months, and a copy of bio-data page of the passport.

√ (2) a signed Confirmation of Online Visa Application (ApplyForm).

√ (3) A photo which must be:
·In color
·Taken in front of a plain white background
·Taken bare-headed
·Face center looking straight
·Taken within the last 6 months

(4) Proof of residency status: Non-Australians need to submit evidence of legal residence in Australia, such as VEVO or ImmiCard.

√ (5) Previous Chinese passport or Chinese visa.

(6) Documents of commercial activity issued by a trade partner in China, or trade fair invitation, or an invitation letter issued by a competition organizer in China which should contain:

Justin 7/6

https://www.grammar-monster.com/lessons/subject_verb_agreement.htm

Homework

20 examples of issue 3 and 4 for (7/6)

20 examples of issues 5 and 6 for (7/8)

20 examples of issues 7 and 8 for (7/10)

20 examples of issues 9 and 11 for (7/12)

Capitalism/Labor

– The farmers have the abundance of goods.
– The farmers are greedy.
– The animals represents the laborers. The common folks. The poor.
– The farmers need to protect their hard work by using fences, guns, and technology.

Medicine created in Germany to make money.
Very expensive. No one can afford it.
Replica medicine exists in India.

Man from China brings replica to China.
At first, we just wanted to make some money.
But then he changed heart, and his purpose changed to wanting to save lives.

The police wanted to stop him.

In life, there is no good or bad guys.
There is only a conflict of interest.
There are different perspectives.

Thesis –

In this world, there is no such thing as good or evil, only a conflict of interest.

subj – stand
verb – cause(s)

[Standing in different perspectives] causes a conflict of interest.

7/7 – write a very good introductory paragraph

(Present Tense)

Hook – As the tractors swallow their homes, the fox family digs faster.
In the book ‘Fantastic Mr Fox’ by Roald Dahl, a group of three farmers hunt for Mr Fox.
Mr Fox steals their goods to feed his starving family.

merge

Thesis

  • Thus, different perspectives cause conflicts of interests.
  • Therefore, different social positions cause conflicts of interests.
  • Your location (on/in) the social hierarchy determines your interests.

Justin’s homework

Revised Introduction

[hook]
“Swoosh, swoosh”, the grass whispers softly. Mr Fox peeks out. Hiding in the shadows, he notices the reflection of a gun’s barrel. The guns fire loudly. The cracking sounds instantly scare Mr Fox back into the hole.

[merge]
In the book ‘Fantastic Mr Fox’ by Roald Dahl, three farmers hunt for Mr Fox because he steals their goods to feed his starving family. The book discusses this problem that arises between the haves and the have nots. The three nasty farmers represent the haves. And the animals represent the have nots.

[explanation]
The animals’ natural tendency is to forage. So they steal from the farmers from time to time. But on the other hand, the farmers work hard to grow their crops. So in this delicate situation, there is no right or wrong.

[thesis]
Therefore, the ones that own everything instinctually wants to prevent the others from access, and this creates a problem in society.

TODO – body paragraphs and conclusion

Supporting paragraphs [3]

Paragraph’s first sentence:

The ones that own everything instinctually wants to prevent the others from access, and this creates a problem in society:

  • 1) Why does the ones that own wants to prevent access? <-- greed - quote - explanation - support
  • 2) Why does the have nots want access? <-- we need to eat/live - quote - explanation - support
  • 3) how does this create a problem? <-- competition for resource - quote - explanation - support

*Conclusion*

Skills to practice

(should be used in paragraphs)
Indeed, In reality, In fact, In addition…etc

but only the standpoint that you (?????? author, you? ) present –

on behalf

√ direct describing/writing style
X indirect

gun vs the guns:
I love to play with guns (hobby, general)
Sorry officer, I love to play with the guns. (<-- in your story, situation, 'the guns' the guns they are referring) (Issue 9) Beware Modifiers between the Subject and the Verb • The group of students often studies together. • The tall and strong athlete always wins. • The book, along with its sequel, is highly recommended. • My brother, along with his friends, is attending the concert. • The dog with the wagging tail loves to play fetch. • Each of the apples in the basket is ripe. • The beautiful flowers in the garden need watering. • A delicious slice of cake satisfies my sweet tooth. • The team with the most points wins the game. • The teacher, along with her assistant, teaches the class. (Issue 11) Collective Nouns Can be Singular or Plural • The committee is meeting tomorrow. • The jury has reached a verdict. • The audience is applauding the performers. • The flock of birds is migrating south for the winter. • The class is studying for the final exam. • The team is practicing for the upcoming match. • The army is preparing for deployment. • The family is going on vacation together. • The staff is working hard to meet the deadline. • The herd of cattle is grazing in the field.