Forum Replies Created
-
AuthorPosts
-
silver darling
Memberok Carlo, thanks for staying with me. As you say your code below DOES work for CATEGORY or TAG archive -
remove_action( 'genesis_before_loop', 'genesis_do_taxonomy_title_description', 15 ); add_action( 'genesis_before_loop', function() { ob_start(); genesis_do_taxonomy_title_description(); $output = ob_get_clean(); echo str_replace( 'class="archive-title"', 'class="myclass"', $output ); }, 15 );
I've been trying to change output on a CUSTOM POST TYPE archive. So i'd blinded your check tag or category archive direction because i was looking at a custom post type archive .. sorry, takes some of us a bit of time and support before it clicks .. So code below will change output for a CPT archive -
remove_action( 'genesis_before_loop', 'genesis_do_cpt_archive_title_description'); add_action( 'genesis_before_loop', function() { ob_start(); genesis_do_cpt_archive_title_description(); //archive.php line 118 $output = ob_get_clean(); echo str_replace( 'class="archive-title"', 'class="myclass"', $output ); }, 10 );
http://soldnetwork.org.uk/resources/
And you've given very useful and adaptable code. Thank you for your time, i've learned a lot there.
cheers
iansilver darling
Memberthanks Carlo,
i had spotted and fixed the unclosed string ' before but that wasn't the problem.
if i dump $output from within your function
remove_action( 'genesis_before_loop', 'genesis_do_taxonomy_title_description', 15 ); add_action( 'genesis_before_loop', function() { ob_start(); genesis_do_taxonomy_title_description(); $output = ob_get_clean(); var_dump($output); echo str_replace( 'class="archive-title"', 'class="myclass"', $output ); }, 15 );
it returns
string(0) ""
.I think the problem is that genesis_do_taxonomy_title_description() needs something passed to it but i have no idea what.
cheers
iansilver darling
Membercheers Carlo,
Thanks for your time but this doesn't seem to work for me. I am a junior php coder but if i test with
... ob_start(); genesis_do_taxonomy_title_description(); $output = ob_get_clean(); var_dump($output); // returns: string(0) "" ...
if i test directly on an archive template with
global $wpdb; //not sure if this needed $tester = genesis_do_taxonomy_title_description(); var_dump ($tester); // returns: NULL
From what i understand genesis_do_taxonomy_title_description() isn't outputting anything, but i'm stuck at what to pass to this function to get some output.
shame because it looked like your code would be useful to modify a lot of genesis function output.
Thanks
iansilver darling
MemberThankyou, that's a great help. I am now due to post my solution back here. Good tutorials on your webs too!
cheers
iansilver darling
MemberThanks Carlo, that helps me see genesis more clearly, much appreciated. Studiopress, maybe you should think about a) producing good documentation and b) adding what Carlo says above to your genesis 'how to'.
My problem is changing the class attribute on the h1 tag:
/wp-content/themes/genesis/lib/structure/archive.php line 50 $headline = sprintf( '<h1 class="archive-title">%s</h1>', strip_tags( $term->meta['headline'] ) );
I want to change class="archive-title" to class="myclass" . I know I could change the h1 styling by hacking the CSS but for clarity and learning 'how to' I would rather hack the php.
Any pointers to how to do that would be very welcome.
cheers
ianJanuary 29, 2015 at 1:50 pm in reply to: Need Help Using Advanced Custom Fields (ACF) with Genesis (and Agency Theme) #138979silver darling
Memberjust an opinion -
I find docs and support for ACF paid version are very good. much better than my experience with genesis so far.
-
AuthorPosts