Page, Post, and 404 Templates - Module 2-3 - Building a WordPress Classic Theme with Pinegrow

SdĂ­let
VloĹžit
  • čas přidĂĄn 30. 07. 2024
  • The Page and Post templates we make in this lesson are a piece of cake compared to the Index template and the header/footer. We also create a basic 404 page with a search form to round out our main template package.
    🧰 Resources:
    • Course Playlist: • Building a WordPress C...
    • Course info and resources on GitHub: github.com/adamslowe/pinegrow...
    • Download the course files: github.com/adamslowe/pinegrow...
    🧭Course Navigation
    • Module 1 - Prerequisite Information and Project Setup
    • Module 2 - Creating the Theme Templates
    2-1 - The Index Template
    2-2 - Header and Footer Template Parts (You are here!)
    2-3 - Page, Post, and 404 Templates
    • Module 3 - Custom Post Types and Custom Blocks
    • Module 4 - Using JavaScript libraries, making back-to-top buttons, using custom code, and more.
    🌐 My Websites:
    • adamlowe.io
    • peakperformancedigital.com
    ✅ Connect with Me:
    • Facebook: / peakperformancedigital
    • LinkedIn: / adasmshawnlowe
    • CZcams: / @adamloweio
    • Twitter: / @adamslowe
    ⚙️Tools I Use:
    • WordPress.org: wordpress.org/
    • Pinegrow Website Editor: pinegrow.com/
    ⌚ Timestamps:
    00:00 - Intro
    00:30 - Page Template
    02:43 - Setting the front page
    04:01 - Post Template
    05:05 - Singular vs. Single Template
    10:27 - 404 Page
    12:48 - Search Form
    14:40 - Search Results Title
    16:55 - Coming up...
    📝Note: I'm not affiliated with Pinegrow in any way. I'm just a happy, paying customer who wants to see the product continue to grow and thrive, and to help build a more active community around it.

Komentáře • 6

  • @joxmanyou
    @joxmanyou Před 2 dny

    This is magic

  • @joxmanyou
    @joxmanyou Před dnem

    Does anyone else get an error when activating "If in_category"? Everything else perfect

    • @AdamLoweIO
      @AdamLoweIO  Před dnem +1

      What error are you seeing? It’s worked fine in all my projects. You may need to check whether you are testing inside and outside the loop. You can also check the php code to help figure out whether Pinegrow is writing bad code or if the issue is on the WordPress end.

    • @joxmanyou
      @joxmanyou Před dnem +1

      @@AdamLoweIO I don't want to abuse your kindness...
      Fatal error: Uncaught ArgumentCountError: Too few arguments to function in_category(), 0 passed in /Users/josanmartinezesquiroz/Local Sites/my-local-site/app/public/wp-content/themes/adam_course/single.php on line 25 and at least 1 expected in /Users/josanmartinezesquiroz/Local Sites/my-local-site/app/public/wp-includes/category-template.php:257 Stack trace: #0 /Users/josanmartinezesquiroz/Local Sites/my-local-site/app/public/wp-content/themes/adam_course/single.php(25): in_category() #1 /Users/josanmartinezesquiroz/Local Sites/my-local-site/app/public/wp-includes/template-loader.php(106): include('/Users/josanmar...') #2 /Users/josanmartinezesquiroz/Local Sites/my-local-site/app/public/wp-blog-header.php(19): require_once('/Users/josanmar...') #3 /Users/josanmartinezesquiroz/Local Sites/my-local-site/app/public/index.php(17): require('/Users/josanmar...') #4 {main} thrown in /Users/josanmartinezesquiroz/Local Sites/my-local-site/app/public/wp-includes/category-template.php on line 257

    • @joxmanyou
      @joxmanyou Před dnem +1

      @@AdamLoweIO I don't want to abuse your kindness... I'm sure it's because of my lack of knowledge.

    • @AdamLoweIO
      @AdamLoweIO  Před dnem +1

      It’s no problem. I’m moving my house today so I don’t have a computer to dig into things too much. It looks like you might be calling the function outside the loop so WordPress doesn’t know the post’s categories in the context of where you are asking it.