Summary: We provide an upper bound to the number of graph homomorphisms from $G$ to $H$, where $H$ is a fixed graph with certain properties, and $G$ varies over all $N$-vertex, $d$-regular graphs. This result generalizes a recently resolved conjecture of Alon and Kahn on the number of independent sets. We build on the work of Galvin and Tetali, who studied the number of graph homomorphisms from $G$ to $H$ when $G$ is bipartite. We also apply our techniques to graph colorings and stable set polytopes.