====== Unterschiede ====== Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
ueberschreibbare-xtreme-funktionen [2013/04/02 12:07] Sunflower [xtreme_post_thumbnail] |
ueberschreibbare-xtreme-funktionen [2019/04/25 14:04] (aktuell) |
||
---|---|---|---|
Zeile 57: | Zeile 57: | ||
==== xtreme_post_headline ==== | ==== xtreme_post_headline ==== | ||
+ | Hier ein Beispiel mit angepasster class für die ''entry-title'', die von google für die hatom-feed Information benötigt wird:. | ||
+ | Dazu wird folgendes markup ergänzt: | ||
+ | <code phpwp> | ||
+ | <?php | ||
+ | // original | ||
+ | $output = sprintf( '<%1$s class="posttitle">%3$s%2$s%4$s</%1$s>', $tag, get_the_title(), $open_link, $close_link ); | ||
+ | |||
+ | |||
+ | // angepasst | ||
+ | $output = sprintf( '<%1$s class="posttitle entry-title">%3$s%2$s%4$s</%1$s>', $tag, get_the_title(), $open_link, $close_link ); | ||
+ | </code> | ||
+ | <code phpwp> | ||
+ | <?php | ||
+ | /* */ | ||
+ | function xtreme_post_headline( $tag = 'h2', $link = TRUE, $echo = TRUE ) { | ||
+ | |||
+ | $default_allowed_tags = array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ); | ||
+ | // Hook for change the allowed tags | ||
+ | $allowed_tags = apply_filters( 'xtreme_allowed_tags_post_headline', $default_allowed_tags ); | ||
+ | $open_link = ''; | ||
+ | $close_link = ''; | ||
+ | |||
+ | if ( ! in_array( $tag, $allowed_tags ) ) | ||
+ | $tag = 'h2'; | ||
+ | |||
+ | if ( $link ) { | ||
+ | $open_link = sprintf( '<a href="%s" rel="bookmark" title="' . esc_attr__( 'Permalink to %s', XF_TEXTDOMAIN ) . '">', get_permalink(), the_title_attribute( 'echo=0' ) ); | ||
+ | $close_link = '</a>'; | ||
+ | } | ||
+ | |||
+ | do_action( 'xtreme_before_post_headline' ); | ||
+ | |||
+ | $output = sprintf( '<%1$s class="posttitle entry-title">%3$s%2$s%4$s</%1$s>', $tag, get_the_title(), $open_link, $close_link ); | ||
+ | if ( $echo ) | ||
+ | echo $output; | ||
+ | else | ||
+ | return $output; | ||
+ | |||
+ | do_action( 'xtreme_after_post_headline' ); | ||
+ | } | ||
+ | /* */ | ||
+ | </code> | ||
==== xtreme_post_subtitle ==== | ==== xtreme_post_subtitle ==== | ||
Zeile 131: | Zeile 173: | ||
</code> | </code> | ||
==== xtreme_html5_post_meta ==== | ==== xtreme_html5_post_meta ==== | ||
+ | Hier gilt zu beachten, daß die function im Moment aufgrund eines Fehlers noch nicht von xtreme-one ausgegeben wird. Um die Ausgabe zu erreichen, ist folgendes zu berücksichtigen: [[xtreme_html5_post_meta-richtig-ausgeben|xtreme_html5_post_meta richtig ausgeben]] | ||
<code phpwp> | <code phpwp> | ||
/* */ | /* */ |