• Mark

    (@encryptdesigns)


    So I have been working on this for over an hour and my eyes are getting tired…can anyone walk my hand through this procedure?

    https://www.coffee2code.com/archives/2004/06/30/plugin-get-custom/

    I know I have to add some code to my Themes >> Default >> index.php to the LOOP. Do I put the code anywhere between the LOOP?

    Then I have to call the PHP code on my page:

    <?php echo get_custom(‘cost’, ‘How much :’); ?>

    Right?

    Then why isn’t it working? I added 4 custom fields and am just trying to get ONE to show up named “cost”.

    I”m sure I am just missing something stupid but can’t figure it out :'(

    Oh please lend a hand!

    Grazi,

    Mark

Viewing 7 replies - 16 through 22 (of 22 total)
  • I spent awhile trying various things to the copy of eventcalendar that I modified for you and not being extremly proficient in PHP, was unable to include custom meta fields yet. Do you really even need them though?

    Are you opposed to just entering in each field (time/cost …) on a new line as you been doing? This would be a lot simpler. I’m sure there is a work around to get textile to correctly add <br /> tags. The problem lies in the fact that my eventcalendar function is pulling the info straight from the database, before anything is done to it, thus I believe that textile may not even have any effect on the events_list function.

    Thread Starter Mark

    (@encryptdesigns)

    No I’m not opposed to doing it. My thing is I am trying to avoid having to put in “br” and “p” HTML tags.

    I did write the developer of the EC2 and maybe he’ll have something he can do for this or release a new version of it to include those.

    I suppose I could write some of my own code that would process the information from a FORM and add the “br” tags so when those are emailed to me all I would have to do would be to copy and paste the information into WP to make the post. That is one workaround I could manage.

    I also have someone else via that other posts I started that is looking into it too.

    If I figure something out about the EC2 issue I’ll let you know:)

    It’s pretty easy to incorporate the custom field data from posts into each event post, but the trick is to then get it back out (i.e. how to have the plugin display it).

    Here’s my mod to the function:

    https://paste.uni.cc/7502

    I’ve named it encrypt_get_events_list(), so it doesn’t conflict. You can drop it in shows.php somewhere, or wrangle it into the plugin file, or what have you. You call it like so:

    <?php encrypt_get_events_list(100, 'j F', 'cost', 'How much :'); ?>

    What I’ve done is, along with getting each loop to cache the custom field data for an “entry”, is to hook the c2c_get_custom() arguments (parameters) on the end of encrypt_get_events_list(). So the parameter order is:

    encrypt_get_events_list(limit, ‘date_format’, ‘c2c_field’, ‘c2c_before’, ‘c2c_after’, ‘c2c_none’, ‘c2c_between’, ‘c2c_before_last’)

    Couple things:

    1. I don’t have to ability to test this as thoroughly as I’d like (we’re talking about having to set up two plugins, changing a few posts to future dates, etc.), but it should run without errors (which is half the battle).

    2. The way this is set up (incorporating c2c_get_custom()), there’s no way to pass more than one custom key to test on. So if you ever need to call two or more, a real separate loop is in order (which could be quickly culled from the innards of encrypt_get_events_list()).

    Thread Starter Mark

    (@encryptdesigns)

    By George you’ve done it!

    But I do want more than one variable and I’ll work with that based on your instructions:)

    Thanks again and its nice to have awesome people like you!

    Taking another look at this it is a little tricky…I’ll tackle adding 3 more tomorrow. I’ve been on this computer for ~12 hours today, time to go home ??

    Thread Starter Mark

    (@encryptdesigns)

    The one workaround thing that I could do instead of usting the Custom Fields would be to figure out to get my shows.php page to format the text better.

    The textile stuff doesn’t work for non WP pages, so is there a way to format the posts outside of WP? Otherwise I’ll have to edit each post and add my HTML code for line breaks, etc…

    I forgot to mention that awhile back I hacked up a version of WordPress (1.5.x) to incorporate the use of extra custom inputs, so I wouldn’t have to go through the existing custom_fields interface. How many fields do you want? If you feel comfortable editing things yourself, this post has instructions to do so, or this post has an already customized zip file for download.

    I still contend that once you get textile to work, it would be much simpler to just have things on separate lines.

    Thread Starter Mark

    (@encryptdesigns)

    I only need 3 more and maybe I’ll take a look at those posts:) Did I ever say that I loved you yet? You and Kafkaesqui are freaking awesome! If you need any custom graphics done let me know! I would love to return the favor with you guys…

Viewing 7 replies - 16 through 22 (of 22 total)
  • The topic ‘Can’t get “Get Custom ” to work for the life of me >:(’ is closed to new replies.