Sadegh Hosseini
Forum Replies Created
-
Thanks, it works in “excerpt_more” hook.
but in “excerpt_length” it doesn’t work.
function excerptLength($length) {
if ( defined('DOING_AJAX') ) {
return 25;
}
}
add_filter('excerpt_length', 'excerptLength');I’ve edited the code but it doesn’t work :
function excerptLength($length) {
if ( is_admin() && ! defined('DOING_AJAX') ) {
return $length;
}
return 25;
}
add_filter('excerpt_length', 'excerptLength', 999);- This reply was modified 1 year, 3 months ago by Sadegh Hosseini.
Thanks for your answer,
Yes my AJAX requests goes via /wp-admin/admin-ajax.php.
This is my AJAX call:
jQuery('.catListItem').on('click', function(e) { e.preventDefault(); jQuery('.catListItem').removeClass('active'); jQuery(this).addClass('active'); jQuery.ajax({ type: 'POST', url: '/wp-admin/admin-ajax.php', dataType: 'html', data: { action: 'filterBlogPosts', category: jQuery(this).data('slug'), }, success: function(res) { jQuery('.blogPosts').html(res); } }) });
and this is the code inside functions.php:
function filter_blogPosts() { $catSlug = $_POST['category']; $ajaxposts = new WP_Query([ 'post_status' => array( 'publish' ), 'posts_per_page' => -1, 'category_name' => $catSlug, 'orderby' => 'date', 'order' => 'desc', ]); $response = ''; if($ajaxposts->have_posts()) { while($ajaxposts->have_posts()) : $ajaxposts->the_post(); $response .= get_template_part('blogPosts'); endwhile; } else { $response = 'empty'; } echo $response; exit; } add_action('wp_ajax_filter_blogPosts', 'filter_blogPosts'); add_action('wp_ajax_nopriv_filter_blogPosts', 'filter_blogPosts');
I didn’t understand where should I add this code:
if ( is_admin() && ! defined('DOING_AJAX') ) {
- This reply was modified 1 year, 3 months ago by Sadegh Hosseini.
- This reply was modified 1 year, 3 months ago by Sadegh Hosseini.
Hi @bcworkz ,
Thanks for your answer,
We can use page.php for all pages, home.php for the homepage, single.php for single posts, and so on.
When my clients open my site, home.php will show them. if they click on a post then single.php will show a different structure to them.
Now this is my problem:
If I load data from REST API, the single.php will not load and data will load in home.php and I can’t change the structure of the page.
So I want a documentation or simple theme that help me to do this.
Hello @alanfuller ,
Thanks for your answer,
I just want to develop a theme that supports continuous music play when I change pages.
for this approach, I need a theme that loads data from REST API with Ajax so it doesn’t reload the header or footer when I change pages.
I’ve found some themes that work like this but I want to develop my own custom theme with custom design.
Hi @realmag777 ,
Thanks for your answer,
I don’t want to translate the plugin,
I want to use the plugin on the website.
There are some custom fields for products in Persian and I want to filter products by that custom fields.
If I use Persian words in that custom fields, the plugin doesn’t work.
Is there any way to solve this problem?You can do a little trick – try adding #.mp3 at the end of your URL. Potentially we could check MP4 files too and see if there is a video track or not.
Thanks a lot. this trick works great.
Side note: @mr-seven Do not use short links in these forums, that has been abused in the past and is expanded when found. I have expanded yours into the link field.
That field cannot be seen by search engines.
I didn’t know that using short link is not permitted.
I will not use short links in future.
ThanksHello Maria,
Here you are:
[ short link expanded into the link field, do not use short links in these forums again ]You can see the problem in the second player on the page.
Thanks
- This reply was modified 2 years, 7 months ago by Yui.
- This reply was modified 2 years, 7 months ago by Jan Dembowski.
Thanks for your reply.
I’ve added a splash image, but when I play it, the splash image will disappear and it shows the black screen.Hi,
1- how much does it cost and how much time do you need to add POST support for your rating plugin so visitors could POST stars through REST API?
2- if you create this feature will you add it to the plugin or it will be just for me?
I’d be thankful if you answer me ASAP
Thanks
Thanks
I couldn’t find “submit ticket” menu item. but I’ve used contact us form.Thanks for your answer.
So users can’t rate through API. am I right?I’ve used “footer global player” for stream and “full player” for player in the pages.
Is there any particular reason you need to remove this?
Yes.
My client has a stream on his site. we need the stream plays continuously when the user changing pages. So I want to load pages via ajax. my custom post type page (music page) has footer in it and when footer loads, it stops the stream, and when I delete footer from page, the player of the page will be disapear.
Now I want to load player without footer to have both stream and player of the page together without stopping the stream.Forum: Plugins
In reply to: [AudioIgniter Music Player] AutoplayThanks for your quick answer.
I’ve found the problem. it’s autoplay policy that prevents the player from autoplay music when the site loads:
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
https://support.mozilla.org/en-US/kb/block-autoplay