How to make changes to style.php [closed]

To remove the style without modifying the original code you can try add this to your style.css .comment.yes { background: none !important; } This will add a new style for that class. The !important part tells the browser not to let another style over-ride that line.

How to check if a category has a parent and child categories?

First of all consider that if the category exists, term_exists function return an array, not a term id. See Codex. So: $term_ids = array(); $term = term_exists(‘categoryone’, ‘category’, 0); if ( is_array($term) && isset($term[‘term_id’]) ) { // term exists as parent cat $term_ids[] = $term[‘term_id’]; // get all the children of the categories $children = … Read more

Conditional for Post Format

There is no “default” post format type, though internally in core, a post that has no post format assigned is usually referred to as standard. So, your first conditional will return false using post-format-normal because there is no such post format – but would still return false using post-format-standard. You could reverse the conditional, and … Read more

Toolbar Hidden in a Virtual Page

The admin bar is initialized on template_redirect. You must be short-circuiting that. The quick and dirty method would be to run _wp_admin_bar_init(); near the top of your page. add_filter(‘wp_title’, function($title, $sep, $seplocation) { return ‘Register’; }, 10, 2); _wp_admin_bar_init(); // <- this <- get_header(); get_template_part(‘includes/breadcrumbs’); get_template_part(‘includes/top_info’); It would be somewhat neater to simply hook your … Read more

How to pass hook variable to function?

You can’t use an action or hook within a function in the way you are expecting. Actions and hooks are about delayed execution You are attaching code that will execute at a later point. After an action is added, your function will continue as normal. Then when the user is actually being registered, your code … Read more

setcookies and header send

The issue you have appears because you set your cookies too late. You have to set it before anything will be rendered. Set your cookies in the your-plugin-file.php file. Also you can check if headers were sent or not by calling headers_sent() function: add_action( ‘init’, ‘wpse8170_init’ ); function wpse8170_init() { if ( !headers_sent() ) { … Read more

Get URI from PodPress using PHP

$meta = get_post_meta(get_the_ID(), ‘_podPressMedia’, true); $meta = maybe_unserialize($meta); if (is_array($meta) && count($meta) > 0) foreach($meta as $item){ //do something… } Please, do not use unserialize/serialize with php data stored structures there is native maybe_serialize/maybe_unserialize. Retriving single value from postmeta table also doesn’t require get_post_custom, all you need to do to use get_post_meta whish will return … Read more

Create “new pages” within the admin section of plugin

The easiest way is to add another $_GET parameter to the URL. In the moment you are viewing admin.php?page=Customer_Search. You could make your links go like admin.php?page=Customer_Search&type=your-page. In your plugins files you can then output the desired content based on that parameter. if($_GET[‘type’] == ‘your-page’) { //output your page … }elseif( ….other pages …

Showing Subcategory Name/Link Instead of Parent Category

Once you can’t know the order of categories returned by get_the_category, I suggest to loop through the categories and fill two arrays, one for parent and one for children. After that if the parents array is empty showing the children, otherwise show the parents: $categories = get_the_category(); if ( ! empty($categories) ) { $parents = … Read more