Hi
Can anyone help me understand how to do the following? I’m thinking its really simple but I am very new to this.
I need to alter a single line of PHP code to make my customisations take effect, and I need to place the customised theme action in the child theme of my wordpress site.
In the parent theme in theme_actions.php there is this line of code:
echo ‘
and i need to change it to:
echo do_shortcode(’
The theme developer advised the following: "to overwrite these, simply use remove_action() in a child theme to remove the HTML output function from the parent, and then add_action() to replace the HTML output function from your child theme.
The do_action() in this content would be do_action( ‘ebor_portfolio_meta’);"
So I understand the idea of all that, but i just don’t know how to write it.
here is the entire section of the php file that includes the line i need to alter:
[php]add_action( ‘ebor_portfolio_meta’, ‘ebor_portfolio_meta_markup’, 10 );
function ebor_portfolio_meta_markup(){
global $post;
echo ‘
- ’;
- ’.(‘Date’,‘marble’).’: ‘.get_post_meta( $post->ID, ‘_cmb_the_client_date’, true ).’ ’;
- ’.(‘Categories’,‘marble’).’: ‘.ebor_the_simple_terms().’ ’;
- ’.(‘Client’,‘marble’).’: ‘.get_post_meta( $post->ID, ‘_cmb_the_client’, true ).’ ’;
- ’.(‘URL’,‘marble’).’: ‘.esc_url(get_post_meta( $post->ID, ‘_cmb_the_client_url’, true )).’ ’;
- ’.$title.’: ‘.$details[$index].’ ’;
if( get_post_meta( $post->ID, ‘_cmb_the_client_date’, true ) && get_option(‘portfolio_date’, ‘1’) == 1 ){
echo ‘
}
if( ebor_the_simple_terms() && get_option(‘portfolio_categories’, ‘1’) == 1 ){
echo ‘
}
if( get_post_meta( $post->ID, ‘_cmb_the_client’, true ) && get_option(‘portfolio_client’, ‘1’) == 1 ){
echo ‘
}
if( get_post_meta( $post->ID, ‘_cmb_the_client_url’, true ) && get_option(‘portfolio_url’, ‘1’) == 1 ){
echo ‘
}
$titles = get_post_meta( $post->ID, ‘_cmb_the_additional_title’, true );
$details = get_post_meta( $post->ID, ‘_cmb_the_additional_detail’, true );
if( $titles ){
foreach( $titles as $index => $title ){
echo ‘
}
}
echo ‘
}
[/php]
How much of this do i need to remove and add?
And when I say i’m really new at this I mean really new! I’ve worked out that a PHP file needs to start with
<?php but what should the end look like? Many thanks for any advice!