New answers tagged

0

Got it done using - .site-header-main { /* -webkit-align-items: flex-start; */ /* -ms-flex-align: start; */ /* align-items: flex-start; */ position: absolute; text-align: center; float: right; display: table; } .site-title{ display:inline; vertical-align: middle; font-size: 30px; font-size: 2rem; line-height: 1.25; ...


0

Taking a quick look, it seems as though it uses CSS Flexbox, which is making the elements wrap. .site-header-main { align-items: center; display: flex; flex-wrap: wrap; } Here are some resources which may help you get a handle on this https://css-tricks.com/snippets/css/a-guide-to-flexbox/ http://www.sketchingwithcss.com/samplechapter/cheatsheet.html


0

This is a css question, so it's off topic, but well, here it is: because you have overflow:hidden on the ul all the buttons/numbers/whatever are cut off, since by default they are outside the box. You need to include list-style-position:inside on your ul to make this work (and change it to ol for an ordered list).


0

Your .sidebar ul li { margin: 0; padding: 0; list-style: none; } Is telling the li not show any list-style on line 493 in your style.css add .sidebar ol li { list-style: decimal; } directly below that line, in line 494 and it should be fixed.


0

If your theme has body_class() in the body tag (normally in header.php) then the category name is added to the body tag as a class e.g. <body class="my-category"> So in a css file you can do .my-category #my-element { background:#FF0000; } To edit the html for the categories to make them card layouts then you would need to edit the category.php ...


1

Wordpress has absolutely nothing to do with responsiveness, neither does themes or plugins. Responsiveness is controlled by media queries (CSS) set in stylesheets and the particular browser the site is viewed in. It is here where screen sizes are determined and checked against available media query rules. Just one note, older browsers like IE6, 7 and 8 does ...


1

It's all down to the theme and possibly any elements on your page that are generated by plugins, which are hard for theme authors to anticipate sometimes.


1

You have a spelling mistake in your CSS. .commentlist should be .comment-list


0

Gradient and boxshadow are fine to put inline. Your trouble will be with the hover states. Luckily there is a trick. You can put the hover styles in an outer element and force inherit on hover. Like this: <div class="myshortcode"> <a style="color:blue;"><span style="color:red;">Content</span></a> </div> In your ...


-3

I have just discovered what the issue was. In my functions.php I was still calling my less.min.js, which was applying the style for some reason, removing that resolved my issue. Thanks!


3

I think you could get around this by pre-running the shortcodes on the page by applying the content filters before the header is output. This should allow any internal shortcodes run inside the included post to add any action hooks properly and thus any needed stylesheets/resources. add_action('wp_loaded','maybe_prerun_shortcodes'); function ...


0

Use this in your css img.social-links { float: right; clear: right; }


0

Add this function to Your plugin-name.php file and before you do that change css and js directory function my-plugin(){ wp_enqueue_style('my-portfolio-style',plugins_url('css/portfolio.css',__FILE__)); wp_enqueue_style('jquery-ui',plugins_url('css/jquery-ui-1.8.18.custom.css',__FILE__)); ...


3

This may be a silly idea, but it might work: 1 Let your shortcode explode to an iframe with a custom query_var (tutorial). Like this: <iframe src="http://www.example.com/?p=123&my_query_var=content_only"></iframe> 2 In your single.php detect the query_var and in that case skip visual header, sidebars, footer - anything not connected to ...


2

Load visual compose css function get_visual_composer_style($id) { return '<style>' . get_post_meta( $id, '_wpb_shortcodes_custom_css', true ) . '</style>'; } Load css based on shortcode function custom_shortcode_scripts() { global $post; if( is_a( $post, 'WP_Post' ) && has_shortcode( ...


0

Every post has a maximum of one format and one status. To echo the format you need: if (get_post_format($post->ID)) echo '<span class="format-' . get_post_format($post->ID); . '"></span>'; To echo the status you need this: if (get_post_status($post->ID)) echo '<span class="status-' . get_post_status($post->ID); . ...


-1

<span class="<?php echo get_post_format_string('video'); ?>"></span> <span class="<?php echo get_post_format_string('status'); ?>"></span> It will use post format as a class. You can check all post format string through this code function get_post_format_strings() { $strings = array( 'standard' => _x( ...


1

You can also try <span class="<?php echo get_post_format($post->ID); ?>"></span> Additional details available here Edited from here: Well according to the link I provided, get_post_format() give you the post format post the post_type post. So if you want to use it in loop, you could try while ( have_posts() ) : the_post(); echo ...


0

Looks like I blocked my self out… I had an .htaccess with password protection running that prevented the script from accessing the file.


1

You should use WordPress's built in function wp_enqueue_style for loading styles. /** * Proper way to enqueue scripts and styles */ function wpdocs_theme_name_scripts() { wp_enqueue_style( 'style-name', get_stylesheet_uri() ); wp_enqueue_script( 'script-name', get_template_directory_uri() . '/js/example.js', array(), '1.0.0', true ); } ...


2

It says right there in the code: <?php // to use a image just replace the bloginfo('name') with your img src and remove the surrounding <p> ?> So just replace this line below that comment: <p id="logo" class="h1" itemscope itemtype="http://schema.org/Organization"><a href="<?php echo home_url(); ?>" rel="nofollow"><?php ...


2

You should mention register function in your Question. Add flush_rewrite_rules( false ); in Your custom_post_type register function. it is necessary when you are creating custom post with archive. example code: function create_my_post_type(){ register_post_type('MyPost', array( 'labels' => array('name' ...


0

Please check first what you get from the_field('image'); $img = get_field('image'); var_dump( $img ); Maybe it's just output array with id, url, width, .. and fix html <div class="b33" style="background-image: url(<?php echo get_field('image');?>);">


0

You could get done by adding code as below. <div class="container" style="background-image: url('<?php echo get_field('image',get_the_ID());?>)'">


1

Well it seems you are using ACF. The you need not echo the_field() only echo get_field('')


1

It is mostly matter of personal preference how to structure this. The typical approaches are: CSS import (used to be popular, but considered kind of meh now); enqueue parent stylesheet as dependency and customize with rules in your stylesheet (more files, less trouble); copy parent stylesheet into child completely either once or repeatedly via build tools ...


2

The closest to a reference technique in core would be [gallery] shortcode. If you look at the source of implementing gallery_shortcode() function you'll see that it: Generates instance number (so multiple shortcodes can be distinguished). Outputs dynamic CSS inline into a page source, for each instance. I wouldn't consider it particularly neat solution, ...


1

In your function.php you can add a custom size, for example: add_image_size ('custom_thumbail', 200, 200); Then once you regenerate thumbnails (recommended plugin by wordpress) it will create these, or any new uploaded images will have this size. Then you can call them in your post. Echo wp_get_attachment_url('your post id', 'custom_thumbail'); ...


1

I use the Aqua Resizer in my theme development. https://github.com/syamilmj/Aqua-Resizer It's pretty easy to implement, and it should do exactly what you want. This function will allow you to resize any existing WordPress image. The below example would create a 200 x 200 image from the WP Medium image, and hard crop it to 200 x 200. $thumb = ...


0

This CSS will make your grey text in some else you want: .widget_posts_wrap .latest-posts .col-md-12 a span {color:#your-hex-code !Important;} This is for subtitles in this widget where you have latest post. And this is for titles: .widget_posts_wrap .latest-posts .col-md-12 h3 a {color: #your-hex-code !important;} Also just note to change ...


2

set_post_thumbnail_size() (and other API functions which add/change sizes) applies to generation while it's active. So existing generated image sizes won't be retroactively affected by it. There are plenty of tools around (plugins, wp-cli) which regenerate files with current sizes configuration.


0

The best way to do this is get the post format and then use the switch statement, like this: $my_format = get_post_format (); switch ($my_format) { case 'quote': $htmlcontent = ... ; break; case 'aside': $htmlcontent = ... ; break; and so on } The function that builds up $htmlcontent starts with declaring some building blocks that are used ...


0

Looking at your list, you are really only changing the default result for excerpts for the image and quote formats (at the moment), you can remove those using the_excerpt filter... add_filter('the_excerpt','custom_post_format_excerpt',99); function custom_post_format_excerpt() { $noexcerptformats = array('quote','image'); if ...


1

Only to append the solution from @luis-sanz, I will add the note that every theme has to have the style.css file enqueued. Following the example https://codex.wordpress.org/Function_Reference/wp_add_inline_style from the codex, we can use get_stylesheet_uri() function and append the dynamic CSS data using the wp_add_inline_style function in the following ...


1

wp_add_inline_style needs to be tied to an existing stylesheet in order to work properly. The inline styles will only be printed when the stylesheet they are attached to is enqueued. This is quite handy to control the scope of the inline styles. If the idea is to have them printed globally, the safest handle to tie them to is that of the active theme main ...


5

That's easy. You have the following CSS rule: a.themify_lightbox, .module-image a, .module-gallery a, .gallery-icon, .themify_lightboxed_images .post a, .themify_lightboxed_images .type-page a, .themify_lightboxed_images .type-highlight a, .themify_lightboxed_images .type-slider a { pointer-events: none; cursor: default; } This rule ...


2

Do you understand the bootstrap framework at all? Your theme has implemented a column width that is smaller than you would probably like. Your content area is wrapped in an offset column that is 50% of the container width. <div class="col-lg-6 col-lg-offset-3"> <!-- content --> </div> If you want to increase the width of your ...


2

You're doing well - just one thing you need to change, and I reckon it's a totally reasonable mistake to make: This: add_action('wp_enqueue_styles', 'alpha_styles'); needs to become add_action('wp_enqueue_scripts', 'alpha_styles'); Why scripts? Because there is no Wordpress action called wp_enqueue_styles. Although the functions are named ...


0

After several tests and fails, I'm going to start over. Thanks for the help.



Top 50 recent answers are included