Skip to content
Antonio D edited this page Jun 4, 2020 · 19 revisions

Welcome to the books4languages-book-child-theme-for-pressbooks wiki!

https://developer.wordpress.org/reference/functions/set_transient/

// https://dashboard.popupsmart.com/dashboard if(strpos($_SERVER['REQUEST_URI'], 'english') !== false && !is_user_logged_in() && is_single('chapter')) :

		//
	else:
		     // either in about us, or contact, or management page is in view
			?>	 <script type="text/javascript"  src="https://apiv2.popupsmart.com/api/Bundle/354620" async></script>

		<?php endif; ?>

Future code:

demo link

Hide Summary secction

Summary and other extended content is only available to registered users.

<style> .textbox.textbox--summary{ display: none; } </style>

Activate for a specifical page // wp-print integration hide exercises global $post;

if( false !== strpos( $post->post_name, 'print' ) ) { // Do Things ?>

<style> .textbox .textbox--exercise{ display: none; } </style>

https://developer.wordpress.org/reference/functions/is_user_logged_in/

<style type="text/css"> YOUR CSS CODE HERE </style> <script type="text/javascript"> YOUR JS CODE HERE </script>

Insertar códigos CSS y JavaScript en

o antes de .

https://stackoverflow.com/questions/28656909/wordpress-multisite-add-function-to-functions-php-to-only-affect-1-site

ContactForm 7 https://code.tutsplus.com/articles/optimizing-contact-form-7-for-better-performance--wp-31255

icon with text with url

Download available for register students Register for download.

IMAGE INSTEAD OF DIV https://stackoverflow.com/questions/10829675/how-to-put-an-image-in-div-with-css

https://developer.wordpress.org/reference/functions/get_post_meta/

<a href="<?php the_permalink() ?>" rel="bookmark">
    <img class="thumb" src="<?php echo esc_url( get_post_meta( get_the_ID(), 'thumb', true ) ); ?>" alt="<?php the_title_attribute(); ?>" />
</a>

https://zeropointdevelopment.com/how-to-use-url-parameters-to-pass-data-to-wordpress/

function prefix_add_content ($content){ if(is_single('chapter') && is_main_query()){ $before = "This comes before the content."; $after1 = '<iframe src="https://worksheet.books4languages.com/english/wp-admin/admin-ajax.php?action=h5p_embed&id=12" frameborder="0" allowfullscreen="allowfullscreen"></iframe>'; $after = "This comes after the content (like my Podcast badge)."; $content = $before . $content . $after1 . $after; } return $content; } add_filter ('the_content', 'prefix_add_content');

?>

// Setting default theme for new sites define( 'WP_DEFAULT_THEME', 'your-theme' );

Table
Clone this wiki locally