• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Adding a function to functions.php

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Adding a function to functions.php

This topic is: not resolved

Tagged: genesis_after_entry_content, WP Broadbean

  • This topic has 4 replies, 2 voices, and was last updated 6 years, 8 months ago by Brad Dalton.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • September 26, 2019 at 9:59 am #493728
    PhilMurray
    Participant

    hi - I am trying to get output from a plugin to appear at the bottom of POSTS on the ARCHIVE page

    i am using a child theme based on Genesis Sample Theme

    what i need to do is add the following function into the ARCHIVES page and have it placed at genesis_after_entry_content

    so my question is how do I achieve that? is it by adding the function to functions.php in my child theme? if so - what parameters do i need to use?

    the function is;

    /**
    * Gets the jobs data (fields and terms) associated with a job.
    *
    * @param array $args An array of args in terms of what to show. See $defaults.
    * @return mixed false if there is no data or a string of html if there is.
    */
    function wpbb_get_job_meta_data( $args = array() ) {
    // string to hold meta data in.
    $meta_output = '';
    // string to hold taxonomy data in.
    $tax_output = '';
    // entire output string.
    $output = '';
    global $post;
    // set some defaults for the args.
    $defaults = array(
    'post_id' => $post->ID,
    'taxonomies' => wpbb_get_registered_taxonomies(),
    'meta' => wpbb_get_job_fields(),
    'show_title' => true,
    );
    // merge defaults with args.
    $args = wp_parse_args( $args, $defaults );
    // add the wrapper start.
    $output .= '<div class="wpbb-job-data__wrapper">';
    // if we should output the title.
    if ( true === $args['show_title'] ) {
    // add the title next.
    $output .= '<h3 class="wpbb-job-data__title">' . esc_html__( 'Job Information', 'wproadbean' ) . '</h3>';
    }
    // add the job data div.
    $output .= '<div class="wpbb-job-data">';
    // handle the job fields first if we have any to handle.
    if ( ! empty( $args['meta'] ) ) {
    // loop through each meta.
    foreach ( $args['meta'] as $field ) {
    // get the value of this field.
    $field_value = get_post_meta( $args['post_id'], $field['id'], true );
    // make sure we have a show_on_frontend set.
    if ( ! isset( $field['show_on_frontend'] ) ) {
    // set to show on both archive and single views.
    $field['show_on_frontend'] = array( 'single', 'archive' );
    }
    // if we are not showing this data on the front end.
    if ( false === $field['show_on_frontend'] ) {
    continue;
    }
    // if this is the salary from or salary to field.
    if ( wpbb_get_job_field_prefix() . 'salary_from' === $field['id'] || wpbb_get_job_field_prefix() . 'salary_to' === $field['id'] ) {
    $value_prefix = wpbb_get_job_currency_symbol( $args['post_id'] );
    } else {
    $value_prefix = '';
    }
    // add this field to the output string.
    $meta_output .= '<div class="wpbb-job-data__field wpbb-job-data__field--' . esc_attr( str_replace( '_', '-', $field['xml_field'] ) ) . '" data-type="meta"><span class="label">' . esc_html( $field['name'] ) . ':</span> <span class="value">' . $value_prefix . $field_value . '</span></div>';
    } // End foreach().
    } // End if().
    // add the meta output to the total output if we have meta output.
    if ( '' !== $meta_output ) {
    $output .= $meta_output;
    }
    // handle the job taxonomy terms first checking we have any.
    if ( ! empty( $args['taxonomies'] ) ) {
    // loop through each taxonomy.
    foreach ( $args['taxonomies'] as $tax ) {
    // if we are not showing on the front end.
    if ( false === $tax['show_on_frontend'] ) {
    continue;
    }
    // get the terms of this post.
    $terms = wp_strip_all_tags(
    get_the_term_list(
    $args['post_id'],
    $tax['taxonomy_name'],
    '',
    ', ',
    ''
    )
    );
    // if we have terms to display.
    if ( '' !== $terms ) {
    // add this to the tax output.
    $tax_output .= '<div class="wpbb-job-data__field wpbb-job-data__field--' . esc_attr( str_replace( '_', '-', $tax['slug'] ) ) . '" data-type="term"><span class="label">' . esc_html( $tax['plural'] ) . ':</span> <span class="value">' . $terms . '</span></div>';
    }
    } // End foreach().
    } // End if().
    // add the meta output to the total output if we have meta output.
    if ( '' !== $tax_output ) {
    $output .= $tax_output;
    }
    // if we have output.
    if ( '' !== $output ) {
    // return output filtered.
    return apply_filters( 'wpbb_get_job_meta_data', $output . '</div></div>', $args );
    }
    return '';
    }

    September 26, 2019 at 10:04 am #493729
    Brad Dalton
    Participant

    What's the name of the plugin?

    What archive page type?

    You can try something like this in a archive.php template or with the is_archive(); conditional tag in your child themes functions file :

    add_action( 'genesis_after_entry_content', 'your_plugin_tag' );
    function your_plugin_tag() {
    
        echo your_function();
    
    }
    

    Where your_function(); is the plugin function you want to output.


    Tutorials for StudioPress Themes.

    September 26, 2019 at 11:05 am #493730
    PhilMurray
    Participant

    hi Brad

    plugin is called WP Broadbean

    archive page is here - for a category called ACTIVE VACANCIES

    https://llcc-ireland.fdmserver.com/job-industry/active-vacancies/

    the plugin seems to generate the /job-industry/ label which is then followed by the category name in the URL

    thanks

    Phil

    September 26, 2019 at 11:15 am #493731
    PhilMurray
    Participant
    This reply has been marked as private.
    September 26, 2019 at 11:17 am #493732
    Brad Dalton
    Participant

    I don't get private messages however you can contact me using [email protected]


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble