Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Display category in project page

Display category in project page

Scheduled Pinned Locked Moved General Discussion
4 Posts 2 Posters 101 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    franksvamp
    wrote on last edited by
    #1

    Hey there!

    I was wondering if there was a way to display the categories of a project in the project's page.

    Best case scenario would be to give it a specific div so I can style each category.

    Do you think it would be possible? That could be done with some PHP code right? or should I manually write the project categories for each project? (preferably not hehe)

    Best,

    Frank

    1 Reply Last reply
    0
    • RichardR Offline
      RichardR Offline
      Richard
      Global Moderator
      wrote on last edited by Richard
      #2

      Dear Frank

      @franksvamp

      Sorry that i cant go deeper into custom coding at the moment but in my opinion this would be best ( i'm not always right, and i'm sure you already knew this šŸŒ )

      I hope some other users speak up too!

      For example the category data (id's) is stored in the body of your project:

      Screen Shot 2022-02-26 at 6.05.35 PM.png

      You could use these to your advantage, or use jQuery to return values of categories as well

      https://laytheme.com/documentation/custom-javascript.html

      See what you get in the developer console when this is added:

      <script>
      window.laytheme.on("newpageshown", function(layoutObj, type, obj){
      	console.log("layoutObj", layoutObj);
      	console.log("type", type);
      	console.log("obj", obj);
      });
      </script>
      

      Best
      Richard
      1 Reply Last reply
      0
      • F Offline
        F Offline
        franksvamp
        wrote on last edited by
        #3

        Hey @Richard ,

        indeed I get an array with the "catid" values.

        Screen Shot 2022-02-26 at 16.36.10.jpg

        However I'm struggling to get the category names out of the id.

        F 1 Reply Last reply
        0
        • F franksvamp

          Hey @Richard ,

          indeed I get an array with the "catid" values.

          Screen Shot 2022-02-26 at 16.36.10.jpg

          However I'm struggling to get the category names out of the id.

          F Offline
          F Offline
          franksvamp
          wrote on last edited by
          #4

          @Richard @Armin-Unruh ,
          Do you think I should write a custom jquery script that translates each number to it's actual category name? and then for each category, display it as a button?

          Or is there a way easier way that I'm not aware of?
          my first obvious solution was to PHP get-category, but I see that it is impossible in Laytheme, right?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          I also code custom websites or custom Lay features.
          šŸ’æ Email me here: šŸ’æ
          info@laytheme.com

          Before you post:
          1. When using a WordPress Cache plugin, disable it or clear your cache.
          2. Update Lay Theme and all Lay Theme Addons
          3. Disable all Plugins
          4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

          This often solves issues you might run into

          When you post:
          1. Post a link to where the problem is
          2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
          3. If the problem is difficult to explain, post screenshots / link to a video to explain it
          Online Users
          J
          JulianeEirich
          dafvD
          dafv
          Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
          laytheme.com
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Recent
          • Tags
          • Popular
          • Users
          • Search