• I need to add <?php bloginfo(‘template_directory’); ?> to my Custom Field values but it doesn’t work.

    My problem is I need to insert that into/before some Custom Field text that are links to other pages on my site. Otherwise I get 404 errors.

    Anyone have any idea how this can be done?

    Thanks in advance!
    Cole

Viewing 3 replies - 1 through 3 (of 3 total)
  • Do you expect your sites URL to change?

    Just do the full URL instead of using the function.

    Thread Starter sb_cole

    (@sb_cole)

    Yeah, I need to keep all URLs relative to the site root due to a server admin requirement. It makes deployment more straight forward and also makes subsequent dev server deployments easier as well. Plus in my testing environment it would be specified as localhost but then I would have to go back and change all of them once deployed to a production server to a different address. Not really an option unfortunately.

    Plus in my testing environment it would be specified as localhost but then I would have to go back and change all of them once deployed to a production server to a different address. Not really an option unfortunately.

    You do understand that you’ll have to do this anyway for any links that are in your posts/pages/other content types? This may not be a concern if you’re not having links in your content, but I haven’t seen to many sites that don’t have those things somewhere. 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Need to insert PHP into custom fields’ is closed to new replies.