0

Im building wordpress theme based on bootstrap, and on default wordpress calendar widget, styling is not matched with bootstrap styling.

However it's very easy to match width of columns in calendar widget.

When widget is activated it's wrapped in

<table id="wp-calendar">

If i am somehow able to add class to that table with that specific id i would solve problem with styling.

So basically instead of

<table id="wp-calendar">

i need to have

<table id="wp-calendar" class="table table-responsive table-striped">

Is there solution to add class to that specific table with that id?

Some php function or jquery?

5 Answers 5

2

using jQuery,

$("#wp-calendar").addClass("table table-responsive table-striped");
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, i don't know which one to upvote and accept, you got all same answer so ill go with first one :P
1
$('#wp-calendar').addClass('table table-responsive table-striped');

Comments

1

Using jQuery you may do it like:

// document ready
$(function(){
    $('#wp-calendar').addClass('table table-responsive table-striped');
});

Comments

1

Well, in jQuery the solution would look like:

$('#wp-calendar').addClass('table table-responsive table-striped');

References:

Comments

1

You can obviously modify the raw HTML and hard code the class name

<table id="wp-calendar" class="table table-responsive table-striped">

Or You can use JQuery function addClass

$('#wp-calendar').addClass('table table-responsive table-striped');

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.