Theme Option’s Save Button is not working
I’ve started rewriting everything using the Settings API and everything is working well now.
I’ve started rewriting everything using the Settings API and everything is working well now.
If you want to query pages you have to choose post_type=page – of course. Another “problem” is that the commen count isn’t exactly representing post/page views. If you really want page views – not comment count – try something like the function below – I got that from here: http://wpsnipp.com/index.php/functions-php/track-post-views-without-a-plugin-using-post-meta/. function getPostViews($postID){ $count_key = ‘post_views_count’; … Read more
Save your data in a single field as either YYYY-MM-DD or UNIXTIME. Then query like this: $args = array( ‘post_type’ => ‘POST_TYPE_NAME’, ‘meta_key’ => ‘date-key-name’, ‘orderby’ => ‘meta_value’, ‘order’ => ‘ASC’, ); $query = new WP_Query( $args ); You should get an order, unless I am having a bad morning, of Day -> Month -> … Read more
In your archive.php file, you would want to replace this: <div class=”entry-content”> <?php colabs_custom_excerpt(); ?> <p class=”more”> <a href=”https://wordpress.stackexchange.com/questions/105195/<?php the_permalink() ?>”> <?php _e(“More”,”colabsthemes”); ?> </a> </p> With this <div class=”entry-content”> <?php the_excerpt(); // or the_content(); ?> </div><!– .entry-content –> The theme creator is MANUALLY inserting the more button (as you can see). You could just … Read more
I prefer changing all: <?php bloginfo(‘template_url’); ?> and <?php bloginfo(‘stylesheet_directory’); ?> into: <?php echo get_template_directory_uri(); ?> For connection to default style.css I prefer to change: <link rel=”stylesheet” href=”https://wordpress.stackexchange.com/questions/105303/<?php bloginfo(“stylesheet_url’); ?>” type=”text/css”> into: <link rel=”stylesheet” type=”text/css” media=”all” href=”https://wordpress.stackexchange.com/questions/105303/<?php bloginfo(“stylesheet_url’ ); ?>” /> I found no script type is defined in any of the scripts: <script src=”https://wordpress.stackexchange.com/questions/105303/<?php … Read more
Simple loop with shortcode rendering problem
Deleting all Options on theme switch
This can be done a lot easier. It is just necessary to change the permalinks settings accordingly – as mentioned on github at the issue 3145: Meet this criteria: // If permalinks contain the shop page in the URI prepend the breadcrumb with shop if ( $shop_page_id && strstr( $permalinks[‘product_base’], “https://wordpress.stackexchange.com/” . $shop_page->post_name ) && … Read more
It’s sometimes a pain to work with post page and/or front page. I do not know if it’s the best solution for you but to me you’d better use front-page.php as the template file for start page. According to the template hierarchy this is recommanded : Used for both Your latest posts or A static … Read more
add_action( ‘wp_enqueue_scripts’, ‘ron_scripts’ ); function ron_scripts(){ if(is_home()){ wp_register_script( ‘homescript’, ‘/wp-content/themes/template/js/menu-home-open.js’ ); wp_enqueue_script( ‘homescript’ ); } else { wp_register_script( ‘nothomescript’, ‘/wp-content/themes/template/js/FILENAMEHERE.js’ ); wp_enqueue_script( ‘nothomescript’ ); } } alternatively replace is_home(); with any other method or code that determines what page you are on. ex: might work if(site_url() == get_permalink()){ //do home stuff } else { //do … Read more