Add your own footer into footer.php

To avoid needing to copy the footer.php file into your child theme and customize it you can use a function in your child theme functions.php file instead: add_action('wp_footer', 'my_custom_footer'); function my_custom_footer(){ //Close PHP tags ?> ADD YOUR PLAIN HTML CODE HERE <?php //Open PHP tags }  

Read More

Add your own header into header.php

To avoid needing to copy the header.php file into your child theme and customize it you can use a function in your child theme functions.php file instead: add_action('wp_head', 'my_custom_header'); function my_custom_header(){ //Close PHP tags ?> ADD YOUR PLAIN HTML CODE HERE <?php //Open PHP tags }  

Read More

Redirect wordpress pages

Redirect wordpress pages to new location on same site Same example if your wordpress is in a sub directory Redirect wordpress category (directory) change

Read More

Screen Resolution

Rules based on screen resolution 2 possibilities: 3 or more possibilities: Max-Width vs Max-Device-Width max-width The width of the target display area, e.g. the browser. When you change the size of the browser on your desktop, the CSS will change, max-device-width The width of the device’s entire rendering area, i.e. the actual device screen. when […]

Read More

Images

  Resizing but keep aspect ratio img.some_class { display: block; max-width: 604px; max-height: 270px; width: auto; height: auto; } This also works well: .some_class img { display: block; max-width: 100%; max-height: 162px; height: auto; } Background Image To Fill DIV Useful for double size images for retina displays, responsive div boxes etc .top_header_logo { background-image: […]

Read More

.Links General

Link To Site Root Link To This Same Page Javascript method Link to same page without URL arguments or Link to same page with URL arguments also or Open in new tab / window Link is a file download Indicate to browser that the link target should be downloaded, not attempted to be displayed

Read More

Using Google Fonts

In a functions.php file use this: function add_google_fonts() { wp_register_style('GoogleFonts', 'http://fonts.googleapis.com/css?family=Coda|Contrail+One'); wp_enqueue_style('GoogleFonts'); } add_action('wp_print_styles', 'add_google_fonts'); Change the font names to the name you wan to us and separate multiple fonts with a '|' character

Read More

DateTime in SELECT queries

Older than # days SqlCommand1->CommandText = "DELETE FROM tblMyTable WHERE DATEDIFF(day, getdate(), MyColumnName) < -10"; //Delete all records older than # days ago SqlCommand1->ExecuteNonQuery();  

Read More

Parameters In Queries

A C++ .Net example using parameters SqlCommand1->CommandType = CommandType::Text; SqlCommand1->Parameters->AddWithValue(“@Type”, Convert::ToString(Type)); SqlCommand1->Parameters->AddWithValue(“@LocationId”, Convert::ToString(LocationId)); SqlCommand1->Parameters->AddWithValue(“@EventDateTime”, EventDateTime->ToString(“s”)); SqlCommand1->Parameters->AddWithValue(“@TagId”, Convert::ToString(TagId)); SqlCommand1->Parameters->AddWithValue(“@TagScore”, Convert::ToString(TagScore)); SqlCommand1->Parameters->AddWithValue(“@SourceId”, SourceId); SqlCommand1->CommandText = “DELETE FROM tblMyTable WHERE Something = @LocationId”; SqlCommand1->ExecuteNonQuery(); SqlCommand1->CommandText = “INSERT INTO tblMyTable ( \ Added, \ Type, \ LocationId, \ EventDateTime, \ TagId, \ TagScore, \ SourceId \ ) VALUES ( \ […]

Read More