Calling JavaScript for specific page irrespective of whichever theme you select

See wp_enqueue_script() for the information how to add scripts without editing the HTML. I assume the script is already registered or you’ll add all necessary parameters. Tied to the particular page ID: if( is_page($page_id) ) { // provide the page ID wp_enqueue_script(‘YOUR_SCRIPT_NAME’); //enqueue the script on success } Tied to the page slug: $slug = … Read more

change page status with code

I figured out how to change the post status and information through code. <?php $my_post = array(‘ID’ => 77, ‘post_title’ => ‘on’,’post_content’ => ‘on’,’post_status’ => ‘draft’,); wp_update_post( $my_post );?> Now I just need to figure out how to make it run when a button is clicked.

Creating content using wp-admin pages

I would suggest that you activate a default theme, such as Twenty Seventeen, to see how it works. You do need .php files to make WordPress work, but these are generally either “theme” files (which basically control the look and feel of the site) or “plugin” files (which add or change functionality, like contact forms). … Read more

Editing pages from dashboard

to display page content in custom theme you should use page.php template, and call the_content() inside the loop. You can also create custom template for different pages and assign them in back end. See: https://developer.wordpress.org/themes/template-files-section/page-template-files/

Add pagination to search.php page

Sometimes pagination will break and give unexpected results, redirect you to the wrong page or give you a 404 (page not found) on the “paged” pages. This is usually due to your theme altering (querying) the main loop wrong. Try updating your .htaccess file by updating the permalink.

Hidden Pages, Posts & Plugins

WooCommerce uses custom post types, so if the client hasn’t actually created Pages/Posts all the content will be under labels like “Products.” I would start by either determining whether there’s an XML sitemap – if they have Yoast SEO installed, you’ll see an “SEO” menu where you can check “XML Sitemaps” and generate one if … Read more

Customise the_title in admin area

I’d leave the public-facing titles (the_title()) alone so you don’t have to mess with filtering things if you change plugins or themes. Adding postmeta is not a big deal, and it’s not hard to maintain/sustain. It also will not get removed/overwritten with updates. The biggest benefit here is that if you forget to add a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)