#BlackFridayMonth: 50% Off WPMU DEV Agency + $360 Free Hosting… FOREVER!

Why wait until the end of the month for Black Friday when you can get amongst our biggest (and only!) sale of the year… RIGHT NOW.

Everyone loves a good Black Friday sale. But NO ONE likes waiting til the end of November for it to finally start.

Which is why, this year, we’ve decided to make Black Friday…

ALL OF NOVEMBER.

Yep, from November 1st, all the way through to the 30th, you can get our biggest sale of the year (well, our only sale of the year!) any time you choose.

We won’t beat around the bush, here’s the deal:

50% OFF Agency ($990 $495/y) + $360 Free Hosting… FOREVER!

That’s our biggest and best plan… All the bells and whistles… Half price… For life!

Plus, your last chance EVER to get the $360 free hosting add-on available with the Agency plan (more on this below).

You get:

  • The Hub site manager (for unlimited sites)
  • Dedicated WP hosting ($360/y value) — last month ever to get this!
  • Fee free client billing (automate all your subscriptions & billing)
  • Professional client portal (your own cPanel for clients)
  • 11 pro WP plugins ($3190/y Value)
  • 250GB Smush CDN ($240/y Value)
  • Unlimited seats (invite colleagues & clients)
  • 24/7 expert live support (for everything WP & beyond)

Over $3,790 value, all for just $990/y $495/y!

(Which, if you take the $360 hosting off is actually $135/y, for the best WPMU DEV plan available)

But here’s what really makes this deal special:

1. It’s for a lifetime

You’ll get to keep this price forever, no matter how many amazing new features and tools we add in future.

2.It’s your last chance to score the $360 free hosting add-on before we remove it from the Agency plan forever

Due to some new and exciting changes to our hosting infrastructure, after this sale we are *taking away* the $360/year hosting credit (enough to host 3 Bronze sites for a year) on this plan for all new members.

Making this month your last chance to get $360 of the best-rated (by Trustpilot no less) WP hosting on the web… forever.

3. It’s completely free to try before you buy.

We know switching or upgrading to a different platform / set of tools isn’t a decision made lightly… no matter how good the deal is.

Good thing you can take our Agency plan for a 7-day no-risk free trial, before you even consider going ahead with the half-price membership.

Not satisfied with the plan during your trial? Cancel, and it’ll be like nothing happened.

On the other hand, if the Agency plan is all you could ask for, and more (which we’re confident it will be), then your 50% off for life will be applied immediately following your trial.

BONUS BF GIVEAWAY: Enter our Black Friday Month caption contests to score this year’s entire BF offer free for your first year!

Remember these dates:

  • Tuesday the 2nd of November
  • Monday the 15th of November
  • Monday the 29th of November

Because this is when we’ll be running our Black Friday-themed comic caption contests (each lasts for a week), where three lucky people will win our entire Black Friday offer (50% off Agency plan + $360 free hosting) FREE for their first year.

If you weren’t aware, we recently released our own WP comics collection and we’ve been running bi-weekly caption contests where, so far, we’ve given away over $200 worth of free hosting.

Subscribe to the The DEV’s Pixels to be first to know about our BF caption contests, and future contests. We’ll also let you know when the contests are running on social.

Only 1000 deals available until the end of November, or when they run out

Obviously we have to put a limit on all this craziness – starting at 1,000 deals (we cannot confirm or deny that we may have extra reserved if we run out of this first batch ;)).

Because if it got picked up overnight and we sold 20k of these then, well, nobody would be able to sleep for the next 3 months as we doubled the team.

But don’t worry, everyone will have plenty of chances to grab a deal and win some amazing prizes over the course of the month.

One final recap…

  • After this month, our Agency plan (the biggest and best plan, all the bells and whistles) will go back to costing $990/yr ($82.50/m).
  • But if you act now, you can lock it in for just $495/yr ($41.25/m), FOR LIFE. You won’t ever have to pay a cent more as long as you’re with us.
  • After this month, the free hosting included with the Agency plan will also drop steeply by 3 times, from $360, down to $120.
  • Meaning from next month on you’ll have to pay $240 extra to get the same level of hosting (up to 3 Bronze hosted sites free for a year).
  • You can take our Agency plan for a no-risk, 7-day free trial first. Your discount will automatically be applied at the end of your trial if you choose to proceed.

So don’t miss out on securing our Agency plan at a ridiculously low lifetime price AND scoring the most free hosting $$ we’ll ever offer.

Get 50% OFF Agency ($990 $495/y) + $360 Free Hosting… FOREVER!

Black Friday Month Q&A

A lot of you will no doubt have questions about this month-long sale, so here’s a few we prepared earlier:

(We’ll add to this if more questions come in throughout the month)

Q: Is this a genuine lifetime deal?

A: Yes it is, we have grandfathered members from a decade ago on their old prices (don’t believe us, ask in the forums) and we’ll do the same for you.

Eventually this plan is going to be $3-5k a year and you’ll have it for $495 (including $360 worth of hosting!), which will feel pretty sweet :)

Q: Is this really the last chance to score $360 free hosting?

A: It really is! Because of some upcoming (and incredibly exciting!) changes to WPMU DEV Hosting, we’ve made the decision to lower the amount of free hosting included with the Agency plan by 3X — from $360, down to $120.

So from next month you’ll have to pay $240 extra to get the same level of hosting (up to 3 Bronze hosted sites free for a year). Grab it while you can.

Q: How can you afford this? / It seems too good to be true!

A: We’ll try and answer it (without going into boring economics), but there are two ways:

Firstly, our hosting costs us less to provision the more of you there are using it (so economy of scale) but also we have found that anybody who tries our hosting loves it so much they generally use it for all of their new sites… So that’s how!

Q: Can I pay this monthly?

A: Sadly not, this is an annual only offer (the money up front also helps us keep it this low).

Q: When the deals run out will you release some more?

A: It always pays to have a backup plan ;), but we’ll cross that bridge when it happens and let you know, stay tuned.

Get 50% OFF Agency ($990 $495/y) + $360 Free Hosting… FOREVER!

my output does not want to reverse

can somone tell me why my output does not want to reverse and the solution to it

#include <stdio.h>
#include <string.h>

#define QUIT_LETTER 'q'

// Again, in a practical program, this is a ridiculously small size
// for an array that is supposed to hold a line of text. But it's
// convenient for testing purposes.
#define LINE_ARRAY_SIZE 10

int eat_til_newline(FILE *stream);
// REQUIRES: stream is open for input.
// PROMISES: Characters are read from stream and discarded until either a
//   '\n' has been read or an input error has occurred.
//   Return value is 0 if '\n' is read, and EOF for an error.

int get_a_line(char *s, int size, FILE *stream);
// Does what fgets does, using repeated calls to fgetc, but
// provides a more useful return value than fgets does.
//
// REQUIRES
//   size > 1. 
//   s points to the start of an array of at least size bytes.
//   stream is open for input.
// PROMISES
//   Return value is EOF if input error occurred.
//   Otherwise, return value gives the index of the '\0' that
//   terminates the string in the array.

void reverse(char *s);

int main(void)
{
  char line[LINE_ARRAY_SIZE];
  int input_error = 0, len;

  while (1) {
    printf("Please enter a line of text. To quit, start it with %c.\n",
           QUIT_LETTER);

    if (NULL == get_a_line(line, LINE_ARRAY_SIZE, stdin)) { 

      input_error = 1;
      break;
    }
    if (line[0] == QUIT_LETTER)
      break;

    // Find out what fgets actually did, and react accordingly.
    len = strlen(line);
    if (line[len - 1] == '\n') { // Case 1: Yay! We read a complete line!
      line[len - 1] = '\0';      // Write '\0' over '\n'.
      printf("The line, newline removed, was \"%s\".", line);
      reverse(line);
      printf("  In reverse, that is \"%s\".\n", line);
    }
    else if (len == LINE_ARRAY_SIZE - 1) { // Case 2: Too much input.
      eat_til_newline(stdin);
      fputs("Input line ignored because it was too long!\n", stdout);
    }
    else {                   // Case 3: Error after reading one or more chars.
      input_error = 1;
      break;
    }
  } // while (1)

  fputs("\nReason for quitting: ", stdout);
  if (input_error)
    fputs("unexpected input error.\n", stdout);
  else
    printf("found %c at beginning of line.\n", QUIT_LETTER);

  return 0;
}

int eat_til_newline(FILE * stream)
{
  int c;
  do {
    c = fgetc(stream);
  } while (c != EOF && c != '\n');

  // Return EOF if c == EOF, otherwise return 0.
  return (c == EOF) ? EOF : 0;

}

int get_a_line(char *s, int size, FILE *stream)
{
  int i=0;
  do{
      if (i>=size -1)
       break;

  *(s+i)=fgetc(stream);
  i++;
  }
   while (*(s+(i-1)) !=EOF && *(s+(i-1)) !='\n');
  return * (s +(i-1));
}


void reverse(char *s)
{
  int n = strlen(s)-1;
  char c;

  for ( int i=i; i<=n/2 ; i++)
  {
    c= *(s+i);
    *(s+ i)=*(s+ n -i);
    *(s+ n -i)=c;
  }

}

10 Top Learning Management Systems APIs

Learning Management Systems (LMS) have evolved from providing student record and course material administration into offering fully enabled physical or virtual classroom tools that encompass personalized learning, performance analytics, school operations, mobile elearning, and even social and collaborative networks.

Developers wishing to create or enhance LMS applications need proper APIs to achieve their goals.

What is a Learning Management Systems API?

How to Set oEmbed Max Width in WordPress (4 Easy Methods)

Do you want to limit the width of oEmbeds in WordPress?

WordPress automatically embeds third-party content like YouTube videos, Tweets, or Facebook posts. However, sometimes the embeds may get too wide and mess up your page layouts.

In this article, we’ll show you how to set oEmbed max-width in WordPress so you can have more control over your site layout.

Setting oEmbed maximum width in WordPress

Why Fix the OEmbed Maximum Width in WordPress?

WordPress allows you to automatically embed content from select third-party websites into your posts and pages using a technology called oEmbed.

This allows you to easily embed YouTube videos, Facebook posts, tweets, and many other types of content on your website. This content is not hosted on your WordPress website. Instead, it’s displayed directly from these third-party sites.

WordPress is quite good at automatically adjusting the width of the embedded content to your website’s content or sidebar areas.

However, sometimes these embedded content may be too wide and overlap your website’s content areas, like in the example below.

A WordPress embed overflowing the content width

To fix this, you’ll need to explicitly tell WordPress to use a maximum width limit for third-party embeds. Unfortunately, there is no option in WordPress settings to do that.

That being said, let’s take a look at how to easily set oEmbed max width in WordPress without breaking anything.

We’ll cover 4 different methods, and you can choose the one that best suits your needs:

  1. Set oEmbed width with WordPress shortcode
  2. Set oEmbed width with WordPress Embed Block
  3. Set oEmbed max width with CSS
  4. Set oEmbed max width with WordPress filter (Code Method)

Method 1. Use the Embed Shortcode in WordPress

This method is easier and works really well for setting a max width for video embeds in WordPress.

Instead of pasting the URL or using the YouTube block, you’ll use the shortcode block. Inside it, you need to use the embed shortcode and include width and height parameters.

[embed width="900" height="600"]https://youtu.be/6LwWumPeues[/embed]

Feel free to change the values of the width and height to your own requirements, and replace the embed URL to your own embed.

Embed shortcode width

You can now preview your post or page and see the embed in action.

oEmbed width adjusted

The embed shortcode and its width and height parameters don’t work for all oEmbed providers. For instance, you cannot use it to set the height and width of a Giphy embed in WordPress.

In that case, you can try one of the alternative methods mentioned below.

Method 2. Use Embed Blocks in WordPress

The default WordPress editor comes with several embed blocks for different oEmbed service providers. You can use them to embed content in different areas of your posts and pages.

Embed blocks in WordPress

Some of these blocks also allow you to change the alignment of the embed and set the content width to wide or full width.

Block width and alignment

You can try using these options to see if it fixes the maximum width issue for the embed.

Method 3. Use CSS to Set Max Width for Embeds in WordPress

By default, WordPress automatically adds CSS classes to different areas of your posts and pages.

It also adds several CSS classes to embed blocks. These CSS classes can be used to set a maximum width for embeds on your WordPress website.

To find out which CSS classes you need to target, simply embed content in a post or page, and then preview it in your browser. Right-click by taking the mouse over to the embedded content and then select the Inspect tool.

Finding CSS classes for embed blocks

You’ll be able to see all the CSS classes added to the embedded element. You can use these classes to set a maximum width for this type of embed.

For instance, if you wanted to set a maximum width for all embeds, then you can use the following custom CSS.

.wp-block-embed {
    max-width: 900px!important;
}

You can also target specific oEmbed providers by using the .wp-block-embed-providername class. For instance, if you wanted to set a maximum width for only Pinterest embeds, then you can use the following custom CSS.

.wp-block-embed-pinterest {
    max-width: 900px!important;
}

Method 4. Set oEmbed Max Width Using WordPress Filter

This last method requires you to add custom code to your WordPress website. If you haven’t done this before, then take a look at our guide on how to easily add custom code snippets in WordPress.

For this method, we will add our own code into WordPress to set the default width for oEmbeds. Simply add the following code to your theme’s functions.php file or the Code Snippets plugin.

add_filter( 'embed_defaults', 'wpbeginner_embed_defaults' );
 
function wpbeginner_embed_defaults() {
    return array(
        'width'  => 400, 
        'height' => 280
    );
}

Don’t forget to adjust the height and width attributes to your own requirement.

The problem with this method is that it only applies the width attribute if the embedded content doesn’t have ‘width’ defined. If the embed code already includes width, then this method may not work.

Bonus Tip

If you regularly embed content from social media platforms to your WordPress website, then you should start using Smash Balloon.

Smash Balloon

It is the best social media plugin for WordPress and allows you to easily embed custom social media feeds in WordPress.

It supports popular social media embeds like YouTube, Twitter, and more. It also allows you to embed Facebook and Instagram content, which is not supported by WordPress.

More importantly, all social media feeds are mobile responsive and work with any WordPress theme.

We hope this article helped you learn how to set an oEmbed max width in WordPress. You may also want to see our complete social media cheat sheet or our expert comparison of the best live chat software for small business.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Set oEmbed Max Width in WordPress (4 Easy Methods) appeared first on WPBeginner.

set autoincrement to the position (COMPETITION) after calculate totalmarks

I have a problem assigning position (number) based on the total marks. Here is the code. TQvm for your assistance
the calculation is done perfectly, the ranking is shown correctly but with no numbers, 1, 2 ,3.....
how to set autoincrement for this field (ranking) which is based on the calculation of the sum.
Tq

$sql ="SELECT idPeserta, SUM(JumlahMarkah) AS JumlahKeseluruhan, PurataMarkah,Kedudukan FROM penilaian GROUP BY idPeserta ORDER BY PurataMarkah DESC"; want to assign the rank to 'Kedudukan'

How to Draw a Mushroom

The mushroom is neither a plant nor an animal, yet it is fascinating. Mycelium, or roots, are found on the surface of the mushroom, creating the appearance of a plant. The plant matter is consumed by the mycelium, but an animal can move freely around the world. The rest of the world’s fungi, however, are...

The post How to Draw a Mushroom appeared first on .