How to create a container in php then customise it in CSS
How to create a container in php then customise it in CSS
How to create a container in php then customise it in CSS
If you want something to display in the footer, you first need to hook it into the footer to display it. So that would look like this: function myLog() { echo ‘test’; } add_action(‘wp_footer’,’myLog’); However, this is not at all connected to the data you want, which is when a new user creates a new … Read more
Thanks for the reply. So in theory, as I have all of the theme files, would I myself be able to make these changes myself so that HTML is supported? It’s generally a bad idea to edit the files of a theme or plugin that you did not develop or that you do not control … Read more
<a href=”#” onclick=”window.open(‘http://google.com’); window.open(‘http://yahoo.com’);”>Click to open Google and Yahoo</a> Please note this will not work if pop-up are disabled – the most you will get is one window. For testing disale your popup blocker in your browser. Note that site visitors who have popups enabled will not see both urls open.
Rather than trying to include jquery with your javascript, you should use wordpress to define jQuery as a dependency to your custom script. function custom_js_script_enqueue(){ wp_enqueue_script( ‘mycustomjs’, CHILD_THEME_URI . ‘/assets/js/my-custom-js.js’, array(‘jquery’), ‘1.0.0’ ); } add_action(‘wp_enqueue_scripts’, ‘custom_js_script_enqueue’); you can read about all of the libraries available in wordpress here. Your script should not include the jquery … Read more
What you want is a page template. It has a PHP comment that tells WordPress its name as a template. The page doesn’t have to have any PHP code, and you can fill it with your HTML instead, which can link to CSS/JS files that you upload separately. Then in WordPress you create a page … Read more
Shortcodes should always return data rather than echoing it. That way it appears in the right place on the page. A couple of ways you can do this: Option 1 – add to variable function my_output() { $output=”<div>” . $myvariable . ‘</div>’; return $output; } Option 2 – use the object buffer function my_output() { … Read more
You can use the variable $current_post, something like this. <?php $query = new WP_Query(array( ‘post_type’ => ‘custom_job’, ‘showposts’ => 12 ) ); ?> <?php while ($query->have_posts()) : $query->the_post(); ?> <?php if ($query->current_post % 3 === 0) :?> <?php $numbers = array(‘One’, ‘Two’); //add the rest ?> <div class=”jobs<?php echo $numbers[floor($query->current_post / 3)];?>”> <?php endif;?> <div … Read more
WordPress doesn’t allow you to paste in a full HTML page, as you’re trying to do. In addition to the nested <html> tag, WP typically prevents JavaScript pasted into the editor from running because it could cause security risks or unknown conflicts. You could create a child theme, which will allow you to set up … Read more
You could make a template for this in your active theme, then assign that page to use the new template file. null-template.php <?php /** * Template Name: Null */ if ( have_posts() ) { while ( have_posts() ) { the_post(); the_title(); echo( wp_strip_all_tags( get_the_content() ) ); } } Then create a new page (or edit … Read more