Lay Theme Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    Custom Content from PHP, Multiple Categories, Tags available

    General Discussion
    3
    7
    688
    Loading More Posts
    • 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
      h2o last edited by

      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 Reply Quote 0
      • mariusjopen
        mariusjopen Global Moderator last edited by

        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 Reply Quote 0
        • H
          h2o last edited by

          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 Reply Quote 0
          • arminunruh
            arminunruh Global Moderator last edited by

            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 Reply Quote 0
            • H
              h2o last edited by

              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 Reply Quote 0
              • mariusjopen
                mariusjopen Global Moderator last edited by

                Dear @h2o
                are you using ACF at the moment?

                Best!

                Marius

                www.mariusjopen.world

                1 Reply Last reply Reply Quote 0
                • arminunruh
                  arminunruh Global Moderator last edited by arminunruh

                  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 Reply Quote 0
                  • First post
                    Last post

                  Before you post

                  Use the Search Feature. Maybe there is already a solution to your issue.

                  1. Update Lay Theme and all Lay Theme Addons
                  2. Disable all Plugins
                  3. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code ", click "Save Changes"
                  4. Now see if your problem solved itself
                  5. Go here, see if your problem is listed here:
                  Troubleshooting

                  When you post:
                  1. Post a link to where the problem is
                  2. If the problem is difficult to explain, post screenshots / link to a video to explain it

                  Thanks!

                  Online Users

                  M
                  M

                  Recent Topics

                  • S

                    Theme crashed - because of Polylang?

                  • J

                    Split Screen just on front page / subpages without the split?

                  • Y

                    image quality dropped

                  laytheme.com