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

Add to previous posts under post

Try to add date_query to the $qry in the solution mentioned here. $qry = new WP_Query( array( ‘cat’ => $current_post_categories[0], ‘posts_per_page’ => 2, ‘post__not_in’ => array( $current_post_id ), ‘date_query’ => array( array( ‘before’ => $post->post_date, ), ), ));