How to prevent encoding plugin HTML output to entities?

With all credits and many thanks to Jacob Peattie in the comment above. After Jacob’s remark that the title is used for e.g. the title element and by some plugins, I followed his advice to create a new field because he made me realize that the front page tagline needed somehow to be seperated from … Read more

How to see in Edit Comments if comment is from User and her Roles

Solved with: function myplugin_comment_columns( $columns ) { return array_merge( $columns, array( ‘ruolo’ => __( ‘Ruolo’ ) ) ); } add_filter( ‘manage_edit-comments_columns’, ‘myplugin_comment_columns’ ); function myplugin_comment_column( $column, $comment_ID ) { switch ( $column ) { case ‘ruolo’: if(get_comment($comment_ID)->user_id != “0”) { if(get_comment($comment_ID)->user_id != “1”) { $ruolo = “”; $user_meta=get_userdata(get_comment($comment_ID)->user_id); $ruolo = “Registrato”; if(in_array(‘vip’, ( array )$user_meta->roles)) … Read more

Else If statement for ACF [closed]

You’re mixing curly brackets and another syntax. This should help: <?php if(get_field(‘hero_video’, ‘option’) ) { $headervideo = get_field( ‘hero_video’, ‘option’ ); echo ‘<div class=”headervideo”>’ . $headervideo . ‘</div>’; } elseif ( get_field( ‘hero_upload’, ‘options’ ) ) { $headerupload = get_field( ‘hero_upload’, ‘option’ ); echo ‘<div class=”hero-video” data-vide-bg=”mp4: ‘ . $headerupload . ‘” data-vide-options=”loop: true, muted: … Read more

I am trying to rewrite urls in WordPress, but its not working

You can try add_action( ‘init’, ‘wpse26388_rewrites_init’, 10, 0); function wpse26388_rewrites_init(){ add_rewrite_rule( ‘^us-dot-numbers/([A-Za-z0-9-]+)/?’, ‘index.php?page_id=642&dotNumber=$matches[1]’, ‘top’ ); } add_filter( ‘query_vars’, ‘wpse26388_query_vars’ ); function wpse26388_query_vars( $query_vars ){ $query_vars[] = ‘dotNumber’; return $query_vars; } Remember to flush_rewrite_rules();

Load font awesome by content in css

In addition to content, you also need to specify font family. Otherwise the browser will use whatever font Divi has assigned to that icon, which is probably not Font Awesome. .get-social-rss .icon:before { content: ‘\f16d’; font-family: FontAwesome; }

Implementation to count page visits of unique visitors based on a cookie

Here’s a minimum working example… (note: this is untested code.) add_action(‘init’, ‘custom_rsvp_handler’); function custom_rsvp_handler() { // for singular posts only // (could also check for event post type here) if (!is_singular()) {return;} // set cookie expiry length (eg. 28 days) $cookielength = time()+(60*60*24*28); // set a cookie key based on post ID global $post; $cookiekey … Read more