Code Monkey home page Code Monkey logo

Comments (24)

Jeradin avatar Jeradin commented on July 19, 2024

Hello,
So you have the "acf-website-field" folder in your theme folder?

Once you have that, you need to edit your functions.php file and add the following line to activate the field for Advanced Custom Fields.

include_once( rtrim( dirname( FILE ), '/' ) . '/acf-website-field/website_url.php' );

Are you getting any error messages?

from acf-website-field.

ericaeide avatar ericaeide commented on July 19, 2024

Yes, the folder is in my current theme folder. When I add that line, I get this:

Fatal error: Class 'acf_Field' not found in /home/content/67/9284167/html/wp-content/themes/shiny/acf-website-field/website_url.php on line 15

from acf-website-field.

ericaeide avatar ericaeide commented on July 19, 2024

Whenever I add the code, I have to re-install my functions.php file via ftp because that's all my whole website displays...

www.morrisnilsenfuneralchapel.com

from acf-website-field.

Jeradin avatar Jeradin commented on July 19, 2024

That error message suggests that you don't have Advanced Custom Fields plugin active I think but could be wrong on that.

http://wordpress.org/extend/plugins/advanced-custom-fields/

from acf-website-field.

ericaeide avatar ericaeide commented on July 19, 2024

Ok. I am able to modify the fields and it shows up in my post editor, so I
know it is activated...

I added the code to add a date & time field, and was able to get that one to
work, but it was different looking code... I found that one here:
http://soderlind.no/archives/2012/03/09/time-picker-field-for-advanced-custom-fields/

Does that help at all?

-----Original Message-----
From: Geet Jacobs
Sent: Monday, May 14, 2012 5:24 PM
To: ericaeide
Subject: Re: [ACF-URL-Field] Need help with this (#1)

That error message suggests that you don't have Advanced Custom Fields
plugin active I think but could be wrong on that.

http://wordpress.org/extend/plugins/advanced-custom-fields/


Reply to this email directly or view it on GitHub:
https://github.com/Jeradin/ACF-URL-Field/issues/1#issuecomment-5703838

from acf-website-field.

ericaeide avatar ericaeide commented on July 19, 2024

Would you be willing to install this for me if I gave you my login info? I've tried everything :(

from acf-website-field.

Jeradin avatar Jeradin commented on July 19, 2024

I apologize for this, I had the wrong includes in my functions instructions.

Can you download a fresh zip and use the following code in your functions.php file?

register_field('Website_field', dirname(File) . '/acf-website-field/website_url.php');

from acf-website-field.

ericaeide avatar ericaeide commented on July 19, 2024

Thank you for checking and fixing it! I am so new at this that I assumed I
was doing something wrong, lol. All is working now and it's exactly what I
was looking for.

-----Original Message-----
From: Geet Jacobs
Sent: Tuesday, May 15, 2012 10:43 AM
To: ericaeide
Subject: Re: [ACF-URL-Field] Need help with this (#1)

I apologize for this, I had the wrong includes in my functions instructions.

Can you download a fresh zip and use the following code in your
functions.php file?

register_field('Website_field', dirname(File) .
'/acf-website-field/website_url.php');


Reply to this email directly or view it on GitHub:
https://github.com/Jeradin/ACF-URL-Field/issues/1#issuecomment-5719173

from acf-website-field.

ericaeide avatar ericaeide commented on July 19, 2024

Oops one more thing. When I add a url and check the box "open in a new
window", it actually makes it open in the same window. If the box is
unchecked, then it opens in a new window.

-----Original Message-----
From: Geet Jacobs
Sent: Tuesday, May 15, 2012 10:43 AM
To: ericaeide
Subject: Re: [ACF-URL-Field] Need help with this (#1)

I apologize for this, I had the wrong includes in my functions instructions.

Can you download a fresh zip and use the following code in your
functions.php file?

register_field('Website_field', dirname(File) .
'/acf-website-field/website_url.php');


Reply to this email directly or view it on GitHub:
https://github.com/Jeradin/ACF-URL-Field/issues/1#issuecomment-5719173

from acf-website-field.

Jeradin avatar Jeradin commented on July 19, 2024

Hey Eric,

Good catch. You can replace line 271 in the php file to correct this.
if($value['internal'] == '1'){ $external = 'target="_blank"';};

What are your thoughts on this, either the default option for all website links is an external link (new window) and when adding the field to give the option to make it internal link?

Or is it better to have the link default as internal link with a user checking if its external?

from acf-website-field.

ericaeide avatar ericaeide commented on July 19, 2024

Thanks again, I will add that in! :)

I would say the default should be external link/new window, with a choice to
make it open in the same window... I guess just because most sites I've come
across seem to do it that way.

Will you be writing any more plugins/custom fields to add on? I wish I knew
how to make some!

Erica

-----Original Message-----
From: Geet Jacobs
Sent: Tuesday, May 15, 2012 4:38 PM
To: ericaeide
Subject: Re: [ACF-URL-Field] Need help with this (#1)

Hey Eric,

Good catch. You can replace line 271 in the php file to correct this.
if($value['internal'] == '1'){ $external = 'target="_blank"';};

What are your thoughts on this, either the default option for all website
links is an external link (new window) and when adding the field to give the
option to make it internal link?

Or is it better to have the link default as internal link with a user
checking if its external?


Reply to this email directly or view it on GitHub:
https://github.com/Jeradin/ACF-URL-Field/issues/1#issuecomment-5728197

from acf-website-field.

Jeradin avatar Jeradin commented on July 19, 2024

Erica, thanks for your thoughts, I agree and have updated the code to do the external link as default with a "Open in Same window" checkbox.

from acf-website-field.

ericaeide avatar ericaeide commented on July 19, 2024

Great. But, question: my links aren't showing up at all now on my posts - I
replaced the php file with the new release. Any ideas?

-----Original Message-----
From: Geet Jacobs
Sent: Wednesday, May 16, 2012 12:20 PM
To: ericaeide
Subject: Re: [ACF-URL-Field] Need help with this (#1)

Erica, thanks for your thoughts, I agree and have updated the code to do the
external link as default with a "Open in Same window" checkbox.


Reply to this email directly or view it on GitHub:
https://github.com/Jeradin/ACF-URL-Field/issues/1#issuecomment-5746513

from acf-website-field.

ericaeide avatar ericaeide commented on July 19, 2024

Wondering if you saw my last message... After the code update, now my links aren't showing up on post pages.

from acf-website-field.

Jeradin avatar Jeradin commented on July 19, 2024

Very sorry Erica, I didnt see your message, oops!

Fixed now, uploaded new file but you can just edit your php file.

Replace line 286 - if($value['url'] == '' ){

from acf-website-field.

ericaeide avatar ericaeide commented on July 19, 2024

No problem, I had forgotten about it too, hehe. Still not showing up for me on the front end, even though I uploaded all new files. Can't figure out what's wrong.

from acf-website-field.

Jeradin avatar Jeradin commented on July 19, 2024

Hmm, not able to duplicate the error. I am seeing any link I add in my post when I add Which I was not before hand I was not before editing the code.

from acf-website-field.

ericaeide avatar ericaeide commented on July 19, 2024

Is there any way to download the old code? I'm so bummed! I've tried with new field names and everything.

from acf-website-field.

Jeradin avatar Jeradin commented on July 19, 2024

If you can edit the php file we can get it back to before.

like 286 :
if($value['url'] == '' ){
return $value;
};

remove all of that except the return $value; part, that should work.

I can email you an older file if you like also.

from acf-website-field.

ericaeide avatar ericaeide commented on July 19, 2024

Ugh :( Now I get an error. Sorry about all this. I could PM you an admin login if you'd be willing to look at it - totally up to you, I appreciate all the help you've given me so far! Like I said I'm pretty new at this. 'memorial_link' is the url field that isn't showing up.

I don't have a single.php in my theme so all my code to display the fields is in the index.php... you'd just search for this:


from acf-website-field.

Jeradin avatar Jeradin commented on July 19, 2024

I dont mind logging in and checking it out for you.

PM away!

from acf-website-field.

ericaeide avatar ericaeide commented on July 19, 2024

Thanks! Couldn't figure out how to PM so I sent a message thru your website link.

from acf-website-field.

Jeradin avatar Jeradin commented on July 19, 2024

That should fix it up!

yay!

from acf-website-field.

ericaeide avatar ericaeide commented on July 19, 2024

Nice, thank you for your help!! What had I done wrong? lol

-----Original Message-----
From: Geet Jacobs
Sent: Tuesday, May 29, 2012 5:54 PM
To: ericaeide
Subject: Re: [ACF-URL-Field] Need help with this (#1)

That should fix it up!

yay!


Reply to this email directly or view it on GitHub:
https://github.com/Jeradin/ACF-URL-Field/issues/1#issuecomment-5998150

from acf-website-field.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.