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. Custom Content from PHP, Multiple Categories, Tags available

Custom Content from PHP, Multiple Categories, Tags available

Scheduled Pinned Locked Moved General Discussion
7 Posts 3 Posters 1.0k 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.
  • H Offline
    H Offline
    h2o
    wrote on last edited by
    #1

    Hi,

    • I use the lay theme as a child theme for a client and want to remove the radio buttons plugin you add in your functions.php. How would I do it with php in the childs function.php? – Why are you doing this? (because of the project arrows?) Whats the downside of removing the radios and enable checkboxes?

    • I want to have custom content generated from php on a particular page, how do I inject the content? Basically i want to loop over a category and display all posts within this category with all the content, not only thumbnails. I wrote a plugin that does the needed and outputs HTML from a shortcode, but when I add a shortcode to a gridder element (+Shortcode) its not in the react-flow, but is appended on every page?

    • Doing the above: is it possible to get the gridder content of a particular page and display it as HTML or JSON that will be parsed?

    • Why are tags disabled? Is there an easy way do enable the tags again in the functions.php of the child theme?

    Let me know if this makes sense.

    Thanks in advance,
    Fabian

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

      Dear @h2o
      we do not recommend to use LayTheme as a child theme. Nor we recommend to edit the PHP because it might change with an update.

      We recommend to have a look into LayGridder: http://laygridder.com/

      There you can use LayGridder within your own Templates.

      Best!

      Marius

      www.mariusjopen.world

      1 Reply Last reply
      0
      • H Offline
        H Offline
        h2o
        wrote on last edited by
        #3

        Mh, that's a bummer. Maybe you should communicate that on your website.
        There is no way you get this info before you purchase it.

        I guess it's not an option, because then i will have more work with the coding of the rest of the site. Your template is nice and i chose it because it works out of the box.

        As you know, if my child theme has it's own functions.php it will not replace the parents function.php, but execute before. So, it will not break anything if one takes care.

        1. remove the radio-options: just make a class Radio_Buttons_for_Taxonomies {} in my childs functions.php, so class_exists fires true and does not continue to register the plugin

        2. if i add content through a shortcode in the laygridder, is not added to the ajax flow on the frontend, but added to the websites html after the ajax-container, bug or feature?
          — LayShortcodes::get_shortcode_contents(); in index.php

        3. add tags: why did you remove it? – i really want to know, because i registered it again with a hook to add_action

        my functions.php looks like this now:
        // initial register radio-buttons class, but empty, to fire class_exists true
        class Radio_Buttons_for_Taxonomies {}

        // re-registers taxonomy after the parents setup due to function priority
        function add_post_type_support() {
        register_taxonomy_for_object_type('post_tag', 'post');
        }
        add_action('init', 'add_post_type_support', 20);

        1 Reply Last reply
        0
        • arminunruhA Offline
          arminunruhA Offline
          arminunruh
          Global Moderator
          wrote on last edited by
          #4

          hey h2o!

          I'm changing lay theme now so it finally supports categories and tags.

          ok so most plugins wait for the document ready event to fire their javascript. that's why when a shortcode is added somewhere, when you visit that page, the website is reloaded, the shortcode is parsed in normal php and then that html is copied into where the shortcode is in the gridder. i know that's kind of complicated and it is a workaround, but most wordpress plugins are just not made for pure javascript frontends, like the frontend of laytheme

          an alternative for you would be to use the "newpage" event ( http://laytheme.com/documentation.html#custom-javascript ) and then build your markup using javascript and the wordpress rest api ( https://developer.wordpress.org/rest-api/ ) .

          If you want to build a child theme, go ahead and do that. But other than changing the header, footer and function files, there's not much to do here. the big reason to do a child theme is to overwrite certain template parts of a theme. Overwriting all these .php files that are part of the template hierarchy for example https://developer.wordpress.org/themes/basics/template-hierarchy/
          But laytheme doesn't have these files, only a index.php and the rest of the frontend is just javascript.

          1 Reply Last reply
          0
          • H Offline
            H Offline
            h2o
            wrote on last edited by
            #5

            ok, works as expected then. i also had a bug in my plugin, custom shortcodes for custom html content works now and integrates in the flow of the website.

            one last question (for now):
            how can i reactivate the tinymce link plugin for the editor when i am using advanced custom fields?

            best and thanks,
            fabian

            1 Reply Last reply
            0
            • mariusjopenM Offline
              mariusjopenM Offline
              mariusjopen
              Global Moderator
              wrote on last edited by
              #6

              Dear @h2o
              are you using ACF at the moment?

              Best!

              Marius

              www.mariusjopen.world

              1 Reply Last reply
              0
              • arminunruhA Offline
                arminunruhA Offline
                arminunruh
                Global Moderator
                wrote on last edited by arminunruh
                #7

                Hey @h2o with the latest update, you can now use multiple categories.

                how can i reactivate the tinymce link plugin for the editor when i am using advanced custom fields?

                Hm, not sure! Does it hide when you use acf?

                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
                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