note: I have found out that some functions that are available in some sources may not be available in these resources I have listed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Add the post thumbnail to admin panel - marcokuemmel.de*/ | |
function my_custom_column_content($column) | |
{ | |
if ($column == 'featuredimage') | |
{ | |
global $post; | |
echo (has_post_thumbnail($post->ID)) ? the_post_thumbnail(array(80,80)) : '<p>kein Bild festgelegt</p>' ; | |
} | |
} | |
// for cpt use manage_{$post_type}_posts_custom_column |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
/** | |
* Default Category Title | |
* | |
* @author Bill Erickson | |
* @url http://www.billerickson.net/default-category-and-tag-titles | |
* | |
* @param string $headline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* This function will get the first image in this order: | |
* | |
* 1) Featured image | |
* 2) First image attached to post | |
* 3) First image URL in the content of the post | |
* 4) YouTube screenshot | |
* 5) Default images for different categories [SET MANUALLY] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//hierarchical | |
//hook into the init action and call create_book_taxonomies when it fires | |
add_action( 'init', 'create_topics_hierarchical_taxonomy', 0 ); | |
//create a custom taxonomy name it topics for your posts | |
function create_topics_hierarchical_taxonomy() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Code Samples for Hooks And Filters Class | |
<?php | |
/* Filter the title to add a page number if necessary. | |
------------------------------------------------------------------------------------ */ | |
add_filter( 'wp_title', 'page_numbered_wp_title', 10, 2 ); | |
function page_numbered_wp_title( $title, $sep ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////////////////////////////////////////////////////////////// | |
// // | |
// Add media size column to media library // | |
// // | |
//////////////////////////////////////////////////////////////////////////////////// | |
// Add custom column to book list | |
function wh_column( $cols ) { | |
$cols["dimensions"] = "Dimensions (h)"; | |
return $cols; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////////////////////////////////////////////////////////////// | |
// // | |
// Create a post from every image in wordpress media gallery // | |
// // | |
//////////////////////////////////////////////////////////////////////////////////// | |
//If you have the image in your media library you can just loop through them and create post via wp_insert_post. | |
// using wp_insert_post() function | |
// snippet from the Codex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: CI Comment Rating | |
Description: Adds a star rating system to WordPress comments | |
Version: 1.0.0 | |
Author: The CSSIgniter Team | |
Author URI: https://cssigniter.com/ | |
*/ | |
//Enqueue the plugin's styles. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*/ https://rudrastyh.com/woocommerce/before-and-after-add-to-cart.html */ | |
// Before Add to Cart Button | |
add_action( 'woocommerce_before_add_to_cart_button', 'misha_before_add_to_cart_btn' ); | |
function misha_before_add_to_cart_btn(){ | |
echo 'Some custom text here'; | |
} | |
// After Add to Cart Button |
NewerOlder