How do I change the labels from Custom Fields?

Photo, amazing way to showcase your architecture, photography or artistic projects | Support forum.
GK User
Wed Jul 22, 2015 1:06 pm
Looking at the "project" pages, I would like to change the text on the page generated by the custom fields as my work is photography, video and installations, not architecture.

I want to change: Size, Completion Date, Credits to new field names such as Medium, Duration, etc.
Where can I edit the custom field information (or add my own new custom field definitions)?

I know I could use html tags to format these things in the description, but they would then appear in the left column, leaving a lot of blank space in the right column.

Thanks
User avatar
Senior Boarder

GK User
Wed Jul 22, 2015 1:42 pm
I tried to simply change the output from one field in content-header.php

<dt><?php _e(‘Credits:’,’photo'); ?></dt> ---> <dt><?php _e(‘Medium:’,’photo'); ?></dt>

but this gave me an error:
Parse error: syntax error, unexpected ':' in /home/...../Photo/content-header.php on line 70
User avatar
Senior Boarder

GK User
Thu Jul 23, 2015 3:58 pm
Hello,

Please revert the original file from the theme package and then please just change the text without commenting the code fragments.

Please remember that custom fields names can be changed in the same file under this code fragment:

Code: Select all
$project_desc = get_post_meta( $post->ID, 'project-description', true );
    $project_credits = get_post_meta( $post->ID, 'project-credits', true );
    $project_date = get_post_meta( $post->ID, 'project-completion-date', true );
    $project_link = get_post_meta( $post->ID, 'project-link', true );
    $project_size = get_post_meta( $post->ID, 'project-size', true );
User avatar
Administrator

GK User
Thu Jul 23, 2015 4:16 pm
So do you mean I can add a new field here?
For example,

Line 15: $project_medium = get_post_meta( $post->ID, 'project-medium', true );

Line 36 and 59: add || $project_medium

Line 73:
<?php if ($project_medium != '') : ?>
<dt><?php _e('Medium:','photo'); ?></dt>
<dd><?php echo $project_medium; ?></dd>
<?php endif; ?>

Will that do everything I need? Thanks in advance!
User avatar
Senior Boarder

GK User
Fri Jul 24, 2015 11:41 am
Yes, it should be everything in this case.
User avatar
Administrator

GK User
Fri Jul 24, 2015 2:01 pm
I changed the content-header.php file as I described above. But when I add a new post, I don't see the new field I added in the "Add new custom field" dropdown menu.

Do I need to "reset" Wordpress for the changes to be seen? Or is there another file I need to change the code too? Or do I need to change some code for the dropdown menu, for example?
User avatar
Senior Boarder

GK User
Mon Jul 27, 2015 9:59 pm
Hi,

@Pavi Could you please provide me with a back-end and FTP access to your website via PM (click the “Private Message” text underneath my avatar) so that I may analyze it?
User avatar
Moderator

GK User
Thu Jul 30, 2015 4:45 pm
Hi Piotr, PM sent. Thanks for looking.
User avatar
Senior Boarder


cron