Viewing 3 reply threads
  • Author
    Posts
    • #6464

      I’m trying to access my Piklist created fields that I want to use in my style.php file so that when the user updates the value in that field from the dashboard of settings tab , the style.php file as well updates and thus generates the same value so that I can have dynamic css values where I need them. I’ve read in some of the posts here on the forum suggesting using Inline styles. I however don’t want to use Inline css styles because the dynamic css code to be used is big enough to make the code untidy if I mix it up in my template file. I thought that by being able to use php in my style.php file which writes/creates style.css, I’d be able to access my Piklist created values as well from that file (style.php) just like I do with normal database stored variables. So far, I’m able to generate the style.css file but when I try to use my piklist created fields that store the values I’d want to use, they return nothing and yet when I echo out the same variables on the page to check whether they return anything, they indicate that they actually hold the data I want to use because they print it out on the frontend. How in the world can access these piklist field values from inside thestyle.php file so that I use them to dynamically change the css property values basing on the data entered by the user into the settings pages or metaboxes?

    • #6469
      Steve
      Keymaster

      @semwangajoshua– How are you accessing the Piklist data? It should work the same as any other WordPress data.

    • #6471

      I have the code below in my style.php file which generates the stylesheet file style.css

      $profile1_color = get_post_meta ($post->ID, 'profile1_color', true);

    • #6474
      Steve
      Keymaster

      @semwangajoshua– This should work… but only when you are viewing that single post.

Viewing 3 reply threads
  • You must be logged in to reply to this topic.