Nice scroll to wordpress

wordpress runs jquery in noconflicts mode which means that you either need to write your JS code using the jQuery function call $(document).ready( function() { jQuery(“html”).niceScroll(); } ); or the following syntax which define $ $(document).ready( function($) { $(“html”).niceScroll(); } );

Looking to exclude blog posts from category Previous/Next buttons

You can exclude categories from your posts page using pre_get_posts function exclude_category( $query ) { if ( $query->is_home() && $query->is_main_query() && !is_admin()) { $query->set( ‘cat’, ‘-1347’ ); } } add_action( ‘pre_get_posts’, ‘exclude_category’ ); Might be better to use the category slug or I.D. Same with the tag. There’s also 5 parameters you might want to … Read more

How to display content from post_parent

As stated by the other answer, you can not pass an ID to get_the_content() function. You could fetch the post using get_post(), but there’s also another handy function that you can use to fetch the content: The get_post_field( $field, $post_id, $context ) function is what you’re looking for: $content = apply_filters( ‘the_content’, get_post_field( ‘post_content’, $post->ID … Read more

Need help on WordPress and php

WordPress is not HTML. It’s PHP-based templates that build the HTML pages. You need more than just a quick answer. You need to learn about the entire process WordPress uses to build pages. Perhaps one place is to start here to figure out how WP works: https://codex.wordpress.org/New_To_WordPress_-_Where_to_Start . And if you are not comfortable with … Read more

Routing a custom php on wordpress

If you’re coming from a Laravel background, you’re going to hate WordPress routing. For our high-functioning WordPress websites, I had to write a whole bunch of routing workarounds to Laravel-ise routes, and it’s definitely not “The WordPress Way.” There’s no neat WordPress way to add routes in code. Your best bet is to leverage the … Read more

How to show order data by multiple ID?

Here is the code that does what I needed. $order_ids = $orders_ids_array ;//array(‘1762′,’1763’); // The order_id echo ‘<table> <thead> <tr style=”font-weight: bold;”> <td style=”width: 50%;”>Название<br>Сумма взноса</td> <td style=”text-align: center;”>Мод игры и<br>Кол-во </td> <td style=”text-align: center;”>ID<br>заявки и<br>участника </td> <td style=”text-align: center;”>Вступить<br>в схватку</td> </tr> </thead> <tbody>’ ; //echo $order_ids ; foreach( $order_ids as $order_id ){ // get … Read more

How can i display 3 post types in same page?

Make sure that your registration arguments for your post types have the public argument set to true or, alternately, publicly_queryable set to true and exclude_from_search set to false. Then, modify your search query by hooking into the pre_get_posts action: function filter_search( $query ) { $postTypes = array( ‘post’, ‘post_type1-Movies’, ‘post_type2-Trailers’, ‘post_type3-Subtitrari’ ); //Here you can … Read more

category not display in word press grammatically

Where are you calling this code? You need to add it to one of the init hooks. If I add that to either a plugin or theme init, then it adds just fine for me, with the $slug typo corrected as Mike pointed out. echo ‘<p>Debug: Loaded functions.php</p>’; function yourtheme_init() { echo ‘<p>Debug: called yourtheme_init</p>’; … Read more