I attempted to give a generalization of Stone-Weierstrass Theorem below, but I am not sure if it is correct. If it is not correct, I would like to have a counterexample.
Let $X$ be a compact Hausdorff space and $A$ a subalgebra of $C(X,\Bbb R)$. Define $\mathop{Fix}(A)=\{x\in X:f(x)=0 \text{ for all }f\in A\}$ and $F_A$ to be the function on $\mathop{Fix}(A)$ taking the fixed values. Then $$\overline{A}=\{f\in C(X,\Bbb R): f|_{\mathop{Fix}(A)}\in\left<F_A\right>\}$$ where $\left<F_A\right>$ is the set of all functions of the form $r_nF_A^n+...+r_1F_A$.
In the special case when $\mathop{Fix}(A)$ is empty, $\overline{A}=C(X,\Bbb R)$ and when there exists a point $x_0$ such that $f(x_0)=0$ for all $x_0$ by the above result again $\overline{A}=V(x_0)$ so indeed this gives a generalization.
The statement is incorrect, look at for example $X=[0,1]$ and $A$ the constant functions. Then $Fix(A)=\emptyset$ (hence $f\lvert_{Fix(A)}$ will satisfy any condition) but $A$ is a closed sub-algebra of $C(X)$.
There are some Stone-Weierstraß versions that are similar: