What hook can I use to modify custom post data before it is displayed on the page?

You can use the_content filter to modify content before it’s output. function my_the_content_filter( $content ) { // maybe limit to archive or single cpt display? if( is_post_type_archive( ‘your-cpt’ ) || is_singular( ‘your-cpt’ ) ){ global $post; $meta = get_post_meta( $post->ID, ‘some-key’, true ); if( false === $meta ){ return $content . ‘some extra content’; } … Read more

How to change Header image depending on language [closed]

This doesn’t have much to do with Genesis, other than you need to hook into the header in one of several ways, with Simple Hooks http://wordpress.org/plugins/genesis-simple-hooks/ or in functions.php. I’ll leave that to you. But using <?php echo qtrans_getLanguage(); ?> do something like this: $currentLang = qtrans_getLanguage(); if($currentLang == ‘fr’) { //show french logo $imageName … Read more

Shortcode and variable

For anyone that comes across this in the future, here is what I figured out: $askavl_instagram_contact_title = get_post_meta(get_the_ID(), ‘askavl_instagram_contact_title’, true); if(isset($askavl_instagram_contact_title) && $askavl_instagram_contact_title != “”) : $tag = str_replace(“#”,””, ((string)$askavl_instagram_contact_title) ); $thumbsize = “220px”; $image_limit = “2”; $easyInstagramSC = “[easy-instagram limit={$image_limit} caption_hashtags=false caption_char_limit=0 author_text=”” thumb_click=’thickbox’ time_text=”” thumb_size={$thumbsize} tag='{$tag}’]”; echo do_shortcode( $easyInstagramSC ); From what I … Read more

Expected ‘add_filter’ (T_STRING)

You are dealing with a class. Most everything has to be inside a class method, not counting class variables/constants. Second, you the syntax is slightly different when adding a class method, rather than a function, to a hook. function widget( $args, $instance ) { add_filter(‘get_avatar’, array($this,’remove_photo_class’)); // the rest of your code } I would … Read more

Different Layerslider by page id?

If you want is_page to accept multiple parameters, you need an array. See http://codex.wordpress.org/Function_Reference/is_page#Examples <?php if(is_front_page()){layerslider(1);} else if(is_page(array(3,36,38,40))){layerslider(2);} else if(is_page(array(46,48,52,58,60,62,64,66,69,71))){layerslider(3);} else (…) ?> Should work. And you don’t need to quote page id’s