CFG for language of all palindromes whose number of 1s is divisible by 3
One way is to use the closure of context-free languages to intersection with a regular language.

In this case, though, it is simple enough to construct the grammar explicitly. The idea is to have three different symbols, $S_0,S_1,S_2$, where $S_b$ generates all palindromes in which the number of 1s is equivalent to $b$ mod 3. The productions for $S_0$ are
$$
S_0 \to 0S_00 \mid 1S_11 \mid 0 \mid \epsilon.
$$
I'll let you figure out the productions for $S_1,S_2$, as well as which symbol is the starting symbol.