JS & Code in Wordpress

Out of context: Reply #14

  • Started
  • Last post
  • 21 Responses
  • cherub0

    mg33 said:
    "I can do with WP, esp customizing themes"

    Oh? well I may need your advice real soon because I'm struggling.

    First things first. For now my entire site is almost entirely single page except 1 simple login landing page. Do I understand correctly that, I need a theme builder, not a page builder right? Because any page you make by default will be placed at somesite.com/somestupidslug not somesite.com If you want to heavily customize your theme(I'm using javascript and php in conjunction with form boxes), You have to do it in appearance>customize correct? Otherwise as mentioned, it creates a slug. So this presents a problem. You either have the choice to make a custom theme with a theme builder(elementor charges $$ for this) and have it be probably insecure, or you could make a child theme, which I found to be obscure and cumbersome as a first time wordpress user. Most annoying of all it didn't even work, but I did find a javascript plugin that I haven't tried yet.

    In fact afaik the bells and whistles headline features that you could get to make migrating your html to wordpress easy as possible, are streamlined toward multipage sites, so you'll not find those amazing options in appearance>customize ...is that correct?

    Overall I'm a bit disappointed in wordpress. If you're new like me and you're trying to migrate a site INTO wordpress, it's a royal PITA : ( having to do this by hand, is basically recreating your website a 2nd time. DOUBLE THE PAIN! GRRRRRR!!!

    • Oh and somehow I managed to install my wordpress to http://somesite.com instead of: http://www.somesite.… which is what I wanted.cherub
    • .htaccess file rewrites everything to a query:
      every somestupidslug becomes: index.php ?p= somestupidslug
      sted
    • wordpress knows what slug is your index (start) page from a database entry what is customizable from the back-end.sted
    • to "heavily customize your theme" you need to create a base theme, with a function.php file. here you can adjust a lot of things about the front-end.sted
    • here you can add/remove every single include css/js file, affect core/plugin functions, interfere with the data before/after specific functionssted
    • in that new theme if you create a file what starts with the name "page_" you can change your "someslug" page to that template and play with the output.sted
    • here is a little halp:
      https://qodeinteract…
      sted
    • understand that everything is a post in the plain output with the same default properties (title, slug, excerpt, base image etc...).sted
    • so pages are special posts, and you can define/change these via that function.php file. (add custom fields, create new types with special data types).sted
    • in these posts contents there is an option to call wordpress core or plugin functions. these are called shortcodes.sted
    • for example the string:
      [simple_function fuck=yes]
      in this text becomes a call to the shortcode function simple_function with the fuck parameter set to yes
      sted
    • when you have this shortcode defined in your themes function.php it will be called from that file.sted
    • if you have a plugin what has this as function.php extension it will be called from that plugin and execute other functions what manipulate the post data.sted
    • Page builders work leveraging this by shitting out enormous amount of included css/js, and processing tons of these shortcodes.sted
    • But you can use simple html templates with minimal amount of included or inline js/css to get what you want.sted
    • more here:
      https://developer.wo…
      remove css from your output:
      https://developer.wo…
      sted
    • add css to your front-end output:
      https://developer.wo…
      sted
    • and made a typo with the page template so the template file name has to start with "page-" and not page_, best is to copy the page.php from one of the startersted
    • themes and see what's in there.sted

View thread