Excerpt keep stripping tags

add_filter( ‘get_the_content_limit_allowedtags’, ‘get_the_content_limit_custom_allowedtags’ ); function get_the_content_limit_custom_allowedtags() { // Add custom tags to this string return ‘<script>,<style>,<br>,<em>,<i>,<ul>,<ol>,<li>,<a>’; } You can also add this code in your functions file and customize which tags you want to allow in excerpts.

How to add class to an html output element in tinyMCE paragraph drop down menu

In my opinion, using the Styles dropdown is useful to show that the particular style you are adding is special and not the theme’s standard element styling for p, h1, h2, etc. The examples in the Codex to be pretty good at outlining this: http://codex.wordpress.org/TinyMCE_Custom_Styles // Callback function to filter the MCE settings function my_mce_before_init_insert_formats( … Read more

Using php inside javascript [closed]

If you want to re-instantiate your countdown timer only after the date has been changed and saved, then, something to the effect of: //In your custom.js file…. //make sure your localized data is a dependency of your custom.js file so you have proper scope to local data jQuery(document).ready(function($){ var date, gapinvite; date = $(‘input[name=”director_date”]’); if … Read more

prevent HTML output if custom field is empty [closed]

Just a simple php if to check the contents of the field before outputting markup. <?php if( $second_comment = get_field(‘second_content_block’) ){ ?> <div class=”page-content-text-additional”> <?php echo do_shortcode(“[vr_jsp] $second_comment [/vr_jsp]”); ?> </div> <?php } ?> You can eliminate the need for adding the class via js using the same method. Some friendly advice- spending a day … Read more

Adding attribute to the post.php form tag in wp-admin

The form is generated in file wp-admin/edit-form-advanced.php. The relevant code starts at line 410 (WP version 4.0.1). Inside the <form> tag an action is fired: <?php do_action( ‘post_edit_form_tag’, $post ); ?> so it should be easy to use this action by hooking some small function to it from functions.php: function post_form_novaidate() { echo ‘ novalidate=”novalidate” … Read more

How are the HTML classes generated?

By default WordPress adds lots of CSS classes in body tag automatically. These body classes are very useful for styling different sections/pages of site without needing to edit theme files unnecessarily. For example WordPress add home CSS class on website front page and blog class on blog posts index page. Similarly in your case, since … Read more

With over a page of content the footer remains where the bottom of the screen was at top scroll

Good news, I seem to have fixed the code. I cleaned up the code for #colophon. I changed it from this: #colophon { background:url(http://kjel.ca/wp-content/uploads/2014/12/footer-img.jpeg) repeat-x bottom center; height:80%; width:100%; position:absolute; margin:0; padding:0; bottom:0; min-width:100%; min-height:1%; } To this: #colophon { background: url(“http://kjel.ca/wp-content/uploads/2014/12/footer-img-2.jpeg”) repeat-x scroll center bottom transparent; height: 100%; position: absolute; width: 100%; background-size: 100% … Read more

Main menu effect visited

If you mean ‘when the user navigates to page X by clicking it’s menu button’, you can use the current_page_item CSS class. Unless you want to modify the plugin code, I don’t think it’s possible unless you set the current_page_item img {content:…} per menu element.

Function Display article [closed]

If you only want The Content (of the main editor of the post) displayed, you can use echo get_the_content(the_ID). If you want more: First, you have to get the post data from the database, with the function get_post, or doing a query with WP_query. Then you can output different parts like title, date, content… accessing … Read more