Hi BCW,
yes I am using the built in WP editor. Thanks for your advice!
I restored the file “theme_actions.php” from the theme download and now every thing is back the way it was.
I am using a theme called Marble and I would like to change the order in which the portfolio isotope filters are displayed!
In the theme the filters are displayed in alphabetical order by category as follows:
ALL / ARCHIVE / COMMERCIAL / OTHER / SHOWREEL
I believe to have found the original code that does this in theme_actions.php it looks like this:
/*
* Displays the isotope filters for the portfolio
*/
add_action( 'ebor_portfolio_filters', 'ebor_portfolio_filters_markup', 10 );
function ebor_portfolio_filters_markup(){
$output = '';
$output = '<ul class="filter"><li><a class="active" href="#" data-filter="*">'.__('All','marble').'</a></li>';
$categories = get_categories('taxonomy=portfolio-category');
foreach ($categories as $category){
$output .= '<li><a href="#" data-filter=".' . $category->slug . '">' . $category->name . '</a></li>';
}
$output .= '</ul>';
echo $output;
}
/*
Please see https://newpage.felipeascacibar.com/
I would like the filters to be displayed as follows:
SHOWREEL COMMERCIAL ARCHIVE OTHER
I was able to remove the “/” between filters in the custom.css by adding:
.fix-portfolio .filter li:after {
content: "";
}
and I removed the “ALL” portfolio filter which was displayed first in the theme by default by deleting it from theme_actions.php:
*/
add_action( 'ebor_portfolio_filters', 'ebor_portfolio_filters_markup', 10 );
function ebor_portfolio_filters_markup(){
$output = '';
$output = '<ul class="filter"><li><a class="active" href="#" data-filter="*">'.__('').'</a></li>';
$categories = get_categories('taxonomy=portfolio-category');
foreach ($categories as $category){
$output .= '<li><a href="#" data-filter=".' . $category->slug . '">' . $category->name . '</a></li>';
}
So far so good. It seems to work the way I would like it to! ?? Any remarks? Do you have any better Ideas so far?
I read in a thread that it was possible to order the filters by slug so I gave SHOWREEL slug=1, COMMERCIAL slug=2, ARCHIVE slug=3 and OTHER slug=4.
I tried to re-format the taxonomy argument into array format like you suggested and continued with the foreeach loop. Like this:
*/
add_action( 'ebor_portfolio_filters', 'ebor_portfolio_filters_markup', 10 );
function ebor_portfolio_filters_markup(){
$output = '';
$output = '<ul class="filter"><li><a class="active" href="#" data-filter="*"></a></li>';
$categories = get_categories( array(
'taxonomy' => 'portfolio-category',
'orderby' => 'slug',
));
foreach ($categories as $category){
$output .= '<li><a href="#" data-filter=".' . $category->slug . '">' . $category->name . '</a></li>';
}
$output .= '</ul>';
echo $output;
}
/*
But after refreshing my browser all I get is and error message:
Parse error: syntax error, unexpected ‘*’ in /homepages/8/d39654049/htdocs/wp_felipe/wp-content/themes/marble/ebor_framework/theme_actions.php on line 56
And from there I have to restore the theme_actions.php from the theme download all over again. ??
Any Idea what I am doing wrong?
Thanks for your help I really appreciate it!!!
Cheers, Fxam