1

So I've built a post system that is pushed into an image grid. When the user clicks on one of the images, a lightbox opens and displays the post content along a feature image via AJAX. Like this: https://code.org/learn

I'm able to get the the post content and the image. However, I would like to be able to pre-stylize them. For example, to be able to push the title in one CSS style, the Categories in other and the content in other to achieve a more designed finish. How do I go about doing this? I'm just realizing that parsing through the post would be out of my scope, and be rather stupid since it would involve a character detection system. But I would like to achieve a well designed solution.

I've built my website on Xtheme and essential grid, the lightbox is the default essential grid one which is fancybox.

Any help is appreciated.

  • I'm unsure what you mean when you say "push the title in one CSS style" Could you clarify? – Chess Byte Dec 9 '16 at 21:13
  • @ChessByte by pushing I mean having the ability to take the corresponding post's title (via php perhaps?) and give it a pre-stylized setting in JS. This would happen in the short program that produces the lightbox. var myAjaxContainer; window.myAjaxLoaded = function(data) {...}; – Joolian Dec 13 '16 at 15:02
0

Create your own child theme containing a functions.php and style.css so if your third party theme gets updated, you do not loose any work you put into it.

In the functions.php enqueue your stylesheet.

function enqueue_my_style() {
    wp_enqueue_style( 'xtheme-custom', get_stylesheet_uri() );
}
add_action( 'wp_enqueue_scripts', 'enqueue_my_style' );

In your style.css write down your CSS mark-up of style adaptions.

Sources:

  • mhmmm, I am not sure this styling would translate into the lightbox. I am gonna try something along these lines. – Joolian Dec 13 '16 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.