navigation link based on custom field

Check out get_next_post_sort and get_previous_post_sort filters. You can modify the ORDER BY clause to whatever you want (including ). For example, if you want to sort the ‘next post’ to be the post with the smallest adjacent post ID: function wp28041_get_next_post_sort($where){ return ‘ORDER BY ID ASC LIMIT 1’; } add_filter(‘get_next_post_sort’, ‘wp28041_get_next_post_sort’); You don’t have to … Read more

WordPress object for comments frame [closed]

So long as you’re in the loop, you can just use the standard template tags: <script type=”text/javascript” charset=”utf­8″> initFrame({ app_id: “”, object_id: <?php the_ID() ?>, object_title: “<?php the_title_attribute() ?>”, object_content: ‘<?php echo wp_trim_words( strip_shortcodes( striptags( get_the_content() ) ), 45 ) ?>’, object_url: “<?php the_permalink() ?>”, arguments_container: “comment-naqeshny”, width: 610 }); </script>

Post type no single page

First, before you start, just reflush your permalinks. It is sometimes strange why the Template Hierarchy fails. You code checks out, and should in theory work. Everything checks out, and to make sure, I tested it on my side. You can use this work around to “force” wordpress to use a template. Here we would … Read more

Handling single.php in Multisite

I’m surprised get_current_blog_id() didn’t work, since that’s probably the best way to approach it. Always try doing a var_dump( $current_blog ) to make sure you’re testing for what you need. Edit (19 Aug 2015): Also, triple check that you know which header you’re expecting to see and that you’re making the change you want in … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)