Displaying custom fields

  • Contents

  • In this tutorial, we will show just the steps for displaying and configuring some custom fields.

    There is an advanced tutorial that goes into more depth that shows a specific project involving Advanced Custom Fields (from which these steps have been extracted): Using Advanced Custom Fields and Snippets to make a Pricing Table

    So, if you want the context of these particular steps, look at it.

    NOTE: Architect can display any basic custom fields. Fields that return arrays or objects, like repeater fields or those in repeater fields, cannot yet be displayed. However, you could write a shortcode to display those and include that in an Architect meta field group.

    Setup your Blueprint

    Setup your Blueprint

    First off, setup a Blueprint that will display from content that has custom fields.

    Setup the content layout

    Setup the content layout

    1. Switch to the Content Layout screen
    2. Set the Components to show to Title, Excerpt, Body, Custom 1 and Custom 2
    3. Adjust all of them in the Layout to be 100% wide

    This next step is the most important of all, and the one that everyone seems to miss!

    4. In Number of custom fields, enter 4 (i.e. Price, recurrence, link and highlight)

    Publish/Update now

    Publish/Update now

    It is very important after adding, removing or changing custom fields that you publish or update this Blueprint. That enables Architect to add or remove the extra tabs for those fields.

    Setup the Price field

    Setup the Price field

    1. Switch to the Custom field 1: price tab
    2. Set Show in custom field group to Custom 1
    3. Select price in the Field name dropdown
    4. Set the Field type as Number
    5. Set the Decimals to 0
    6. Enter Prefix text of $ (or your own currency symbol)
    7. Enter 99 in the Suffix text.

    Because Architect allows you to format the prefix and suffix text independently of the main text, we can enter the $ and 99 here and then format them to achieve the same look as in the example we a copying.

    Setup the link field (the Add to cart link)

    1. Switch to the Custom field 3: link_text tab
    2. Set Show in custom field group to Custom 2
    3. Select link_text in the Field name dropdown
    4. Select link_url as the Link field
    Additional notes

    Additional notes

    Architect version used to make this tutorial: 1.1.7

    Hosting defaults can seriously affect sites with many custom fields.

    Using custom fields greatly increases the number of input fields in the Architect Blueprint. Each custom field you add to a Blueprint, adds 50 input fields (between its settings and its CSS)

    PHP has a default limit of max_input_vars of 1000.

    If this is exceeded, some fields won't get saved.

    It is easily changed by updating your PHP.ini file with this:

    max_input_vars = 2000

    or your .htaccess with:

    php_value_max_input_vars 2000

    As WordPress gets used more and more for major applications rather than just blogs and CMSes, this will become a more common problem. However, hopefully, hosts will start changing the default to 2000 or more.

    For more information, see these posts: http://jonathannicol.com/blog/2014/03/02/wordpress-custom-fields-not-saving-phps-max_input_vars-may-be-to-blame/


    If you are working with WooCommerce, Advanced Custom Fields, or any other plugin that adds many fields to your WordPress, the following plugin is highly recommended for debugging this issue.