Support » Plugin: Aparat for WordPress » Solving this plugin problems

  • Resolved Ali


    If you are like me looking for a plugin to show the latest videos from, this is the only plugin but it may have some problems that i explain here how to fix them:

    1- If you use its widget and the page rendering stopped right there, the allow_url_fopen is disabled in your hosting, if you cannot change it (there are many ways to do this) you have to change wp-aparat/aparat.php and replace this line

    $item_page = file_get_contents( $item->get_permalink() );
    with something like this

    $url = $item->get_permalink();
    $ch = curl_init();
    curl_setopt ($ch, CURLOPT_URL, $url);
    curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 5);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
    $contents = curl_exec($ch);
    if (curl_errno($ch)) {
    echo(“Error loading file”);
    echo curl_error($ch);
    } else {

    if (!is_string($contents) || !strlen($contents)) {
    echo(“Error loading file”);
    $item_page = $contents;`

    2- it doesn’t show the date correctly, to fix this replace this
    <?php if ( function_exists( 'jdate' ) ) { echo jdate( "j F Y", $item->get_date() ); } else { echo date( "j F Y", $item->get_date() ); } ?>
    to this
    <?php echo date_i18n( "j F Y", strtotime($item->get_date()) ); ?>
    in the same file.

    3- If you also don’t like the video title font, remove the following line from wp-aparat/assets/css/style.css/style file:
    font-family: IRANSans-Light-web;

    Good luck

  • The topic ‘Solving this plugin problems’ is closed to new replies.