Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action( 'after_setup_theme', 'et_setup_theme' );
- if ( ! function_exists( 'et_setup_theme' ) ){
- function et_setup_theme(){
- require_once(TEMPLATEPATH . '/epanel/custom_functions.php');
- require_once(TEMPLATEPATH . '/includes/functions/comments.php');
- require_once(TEMPLATEPATH . '/includes/functions/sidebars.php');
- load_theme_textdomain('Glow',get_template_directory().'/lang');
- require_once(TEMPLATEPATH . '/epanel/options_glow.php');
- require_once(TEMPLATEPATH . '/epanel/core_functions.php');
- require_once(TEMPLATEPATH . '/epanel/post_thumbnails_glow.php');
- include(TEMPLATEPATH . '/includes/widgets.php');
- }
- }
- add_action('wp_head','et_portfoliopt_additional_styles',100);
- function et_portfoliopt_additional_styles(){ ?>
- <style type="text/css">
- #et_pt_portfolio_gallery { margin-left: -15px; }
- .et_pt_portfolio_item { margin-left: 15px; }
- .et_portfolio_small { margin-left: -40px !important; }
- .et_portfolio_small .et_pt_portfolio_item { margin-left: 31px !important; }
- .et_portfolio_large { margin-left: -27px !important; }
- .et_portfolio_large .et_pt_portfolio_item { margin-left: 9px !important; }
- </style>
- <?php }
- function register_main_menus() {
- register_nav_menus(
- array(
- 'primary-menu' => __( 'Primary Menu' ),
- 'secondary-menu' => __( 'Secondary Menu' )
- )
- );
- };
- if (function_exists('register_nav_menus')) add_action( 'init', 'register_main_menus' );
- if ( ! function_exists( 'et_list_pings' ) ){
- function et_list_pings($comment, $args, $depth) {
- $GLOBALS['comment'] = $comment; ?>
- <li id="comment-<?php comment_ID(); ?>"><?php comment_author_link(); ?> - <?php comment_excerpt(); ?>
- <?php }
- }
- /* Display Posts as Choices */
- add_action('gform_pre_render', 'populate_post_type');
- function populate_post_type($form){
- $dropdown_field = 2; // update to the ID of your drop down field
- $post_type = 'review'; // update
- $choices = ounce_posts_as_choices($post_type);
- foreach($form['fields'] as &$field){
- if($field['id'] == $dropdown_field)
- $field['choices'] = $choices;
- }
- return $form;
- }
- function ounce_posts_as_choices($post_type = 'post', $first_choice = '') {
- $posts = get_posts("post_type=$post_type");
- $choices = array();
- $i = 0;
- if($first_choice){
- $choices[$i]['text'] = $first_choice;
- $choices[$i]['value'] = '';
- $i++;
- }
- foreach($posts as $post) {
- $choices[$i]['text'] = $post->post_title;
- $choices[$i]['value'] = $post->ID;
- $i++;
- }
- return $choices;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement