This file contains hidden or 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 | |
| global $post; | |
| $number = 0; | |
| $args = array( 'posts_per_page' => -1, 'post_type'=> 'posttype', 'orderby' => 'menu_order', 'order' => 'ASC' ); | |
| $myposts = get_posts( $args ); | |
| foreach( $myposts as $post ) : setup_postdata($post); ?> | |
| <li data-target="#myCarousel" data-slide-to="<?php echo $number++; ?>"></li> | |
This file contains hidden or 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
| $(window).scroll(function() { | |
| if ($(window).scrollTop() > 100) { | |
| $('.main_h').addClass('sticky'); | |
| } else { | |
| $('.main_h').removeClass('sticky'); | |
| } | |
| }); | |
| if you want to add stick menu on custom div scroll |
This file contains hidden or 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
| <script type="text/javascript"> | |
| <!-- | |
| var message="Copy Protected Enable"; | |
| /////////////////////////////////// | |
| function clickIE() {if (document.all) {(message);return false;}} | |
| function clickNS(e) {if | |
| (document.layers||(document.getElementById&&!document.all)) { | |
| if (e.which==2||e.which==3) {(message);return false;}}} | |
| if (document.layers) |
This file contains hidden or 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
| $author_id= get_the_author_meta('ID'); | |
| echo count_user_posts( $author_id ); | |
| Outside loop | |
| echo count_user_posts( 1 ); |
This file contains hidden or 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
| On contact form 7 editor’s Additional Settings field section, just add this code. | |
| on_sent_ok: "location = 'http://example.com/';" | |
| # |
This file contains hidden or 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 if (is_user_logged_in() ): ?> | |
| <a href="<?php echo wp_logout_url() ?>" title="Logout">Logout</a> | |
| <?php else: ?> | |
| <a href="http://example.com/wp-login.php" title="Logout">Member Login</a> | |
| <?php endif ?> |
This file contains hidden or 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
| function my_custom_theme_widgets() { | |
| register_sidebar( array( | |
| 'name' => 'My Widget', | |
| 'id' => 'widget_id', | |
| 'before_widget' => '<div class="widget_div">', | |
| 'after_widget' => '</div>', | |
| 'before_title' => '<h2>', | |
| 'after_title' => '</h2>', | |
| ) ); |
This file contains hidden or 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
| Register custom post type | |
| add_action( 'init', 'my_theme_custom_post' ); | |
| function my_theme_custom_post() { | |
| register_post_type( 'cpt', | |
| array( | |
| 'labels' => array( | |
| 'name' => __( 'CPTs' ), | |
| 'singular_name' => __( 'CPT' ) | |
| ), |
This file contains hidden or 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
| Register wordpress menu | |
| add_action('init', 'my_theme_register_menu'); | |
| function my_theme_register_menu() { | |
| register_nav_menu( 'main-menu', 'Main Menu'); | |
| } | |
| // Default menu | |
| function my_theme_default_menu() { |
This file contains hidden or 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
| Make sure you used this before </head> | |
| If you have favicon as .ico format, you can use this code. | |
| <link type="image/x-icon" rel="shortcut icon" href="<?php echo get_template_directory_uri(); ?>/img/favicon.ico"> | |
| If you have favicon as png image format, you can use this code. Make sure your favicon size is 16x16px |