Using Beans to theme WP Jobs Manager plugin


Hey Thierry,

I'm working on the WP Jobs Manager theme and I'm trying to re-write some of the core plugin templates using Beans markup (similar to what I did for WC), but despite the markup being registered correctly (Beans markup id's getting added), I'm not able to move them around.

I created a simplified test case using the code below.

This is the single job layout template:

<?php

global $post;

echo beans_open_markup( 'jobster_listing_wrap', 'div', array( 'class' => 'single_job_listing' ) );
 do_action( 'single_job_listing_start' );
  echo beans_open_markup( 'jobster_listing_description', 'div', array( 'class' => 'job_description' ) );
    echo apply_filters( 'the_job_description', get_the_content() );
   echo beans_close_markup( 'jobster_listing_description', 'div' );
    if ( candidates_can_apply() ) :
     get_job_manager_template( 'job-application.php' );
    endif;
  do_action( 'single_job_listing_end' );
echo beans_close_markup( 'jobster_listing_wrap', 'div' );

?>

...and the single job meta:

<?php
/**
 * Single view Job meta box
 *
 * Hooked into single_job_listing_start priority 20
 *
 * @since  1.14.0
 */

global $post;

do_action( 'single_job_listing_meta_before' );

echo beans_open_markup( 'jobster_listing_meta_wrap', 'ul', array( 'class' => 'job-listing-meta meta' ) );
  do_action( 'single_job_listing_meta_start' );
 echo beans_open_markup( 'jobster_listing_meta_location', 'li', array( 'class' => 'location' ) );
    echo the_job_location();
  echo beans_close_markup( 'jobster_listing_meta_location', 'li' );
 do_action( 'single_job_listing_meta_end' );
echo beans_close_markup( 'jobster_listing_meta_wrap', 'ul' );

do_action( 'single_job_listing_meta_after' );

?>

Then in the view template, I have the following:

<?php

// Setup page view
add_action( 'beans_before_load_document', 'jobster_job_setup' );

function jobster_job_setup() {
  beans_remove_action( 'beans_post_title' );
  beans_remove_markup( 'beans_post_title' );
  beans_remove_action( 'beans_breadcrumb' );
  beans_remove_markup( 'beans_breadcrumb' );
  beans_modify_action_hook( 'beans_post_image', 'jobster_page_title_before_markup' );
  beans_add_attribute( 'beans_post_image', 'class', 'uk-border-circle uk-display-inline-block uk-overflow-hidden' );
  beans_modify_action_hook( 'jobster_listing_meta_wrap', 'jobster_page_title_before_markup' );

}

/*
 * Full width layout.
 */
add_filter( 'beans_layout', 'jobster_full_width_layout' );

function jobster_full_width_layout() {

    return 'c';

}

// Add the job title
add_action( 'beans_header_after_markup', 'jobster_job_page_title' );

function jobster_job_page_title()  {

 echo beans_open_markup( 'jobster_page_title_wrap', 'div', array( 'class' => 'tm-page-title uk-text-center' ) );
   echo beans_open_markup( 'jobster_page_title', 'h1', array( 'class' => 'uk-margin-remove uk-text-uppercase' ) );
     echo get_the_title();
   echo beans_close_markup( 'jobster_page_title', 'h1' );
 echo beans_close_markup( 'jobster_page_title_wrap', 'div' );

}

// Load Beans
beans_load_document();

Any idea why it's not working?

Thanks homey!

Chris

Write a reply

Login or register to write a reply, it's free!