0
私のテーマのショートコードの1つを修正して、クラスIDを列に渡す必要があります。私は追加のパラメータid=""
を入れて、任意のIDを入れることができる必要があります。ショートコードの中でIDを渡す方法 - WordPress
これらはショートコードです:
if (!function_exists('two_col_50_50_col1')) {
function two_col_50_50_col1($atts, $content = null) {
return '<div class="two_columns_50_50 clearfix"><div class="column1"><div class="column_inner">' . do_shortcode($content) . '</div></div>';
}
}
add_shortcode('two_col_50_50_col1', 'two_col_50_50_col1');
if (!function_exists('two_col_50_50_col2')) {
function two_col_50_50_col2($atts, $content = null) {
return '<div class="column2"><div class="column_inner">' . do_shortcode($content) . '</div></div></div>';
}
}
add_shortcode('two_col_50_50_col2', 'two_col_50_50_col2');
まあ、彼はクラス属性にIDを望んでいました。だから私はIDの値を追加した '$ a ['id']'は、最初のhtml要素のclass属性です。 –